1

I have tried the rsync command from this post (with a different endpoint ofcourse):

Can a Raspberry Pi be used to create a backup of itself?

sudo rsync -avH --delete-during --delete-excluded --exclude-from=/usr/bin/rsync-exclude.txt / /mnt/mac-share/rsync/

With the following exluded files:

/proc/*
/sys/*
/dev/*
/boot/*
/tmp/*
/run/*
/mnt/*

.Trashes
._.Trashes
.fseventsd
.Spotlight-V100
.DS_Store
.AppleDesktop
.AppleDB
Network Trash Folder
Temporary Items

.bash_history
/etc/fake-hwclock.data
/var/lib/rpimonitor/stat/

The result seems to be what I want, but during the process I can see that it tries to access files that are excluded like this one, which would mean an ever growing tree-structure, were it to succed:

rsync: symlink "/mnt/mac-share/rsync/usr/share/zoneinfo/posix/Europe/Copenhagen" -> "../../Europe/Copenhagen" failed: Operation not supported (95)

This is just one of many files it tries to access in an excluded folder (and in this case on an excluded mount under the endpoint of /mnt/mac-share/rsync/).

Is this normal behaviour for rsync, to access files in folders that are excluded, which seems like a waste of time, or can it be done better somehow?

EDIT: rsync comes up with this at the end:

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]

Laust
  • 13
  • 3
  • If you are trying to `rsync` to a Mac this is not possible. – Milliways Jul 30 '16 at 11:54
  • @Milliways: I am using rsync on the Raspberry Pi with the Mac share as destination. Can you elaborate on what it is that is not possible? – Laust Jul 30 '16 at 12:03
  • @Milliways: I am not trying to backup any files from the Mac - only local files on the Raspberry Pi. – Laust Jul 30 '16 at 12:06
  • I had tried with `rsync` over a network See http://raspberrypi.stackexchange.com/a/31588/8697. Even using a mounted share on a Mac, OS X will not let you access many of the directories. El Capitan is even worse in this respect than older OS. – Milliways Jul 30 '16 at 12:10

1 Answers1

0

during the process I can see that it tries to access files that are excluded like this one ... /mnt/mac-share/rsync/usr/share/zoneinfo/posix/Europe/Copenhagen

That's not during the scan of the sender (Pi) side; it is inside the destination folder, /mnt/mac-share/rsync/, and corresponds to /usr/share/zoneinfo/posix/Europe/Copenhagen, which is not excluded.

Although rsync has -l and -L options for specifying exactly what to do with symlinks (see man rsync, and also -k and -K; and perhaps search through the whole page for references to "symlink" with /symlink), what it does without such is ambiguous (and may have changed at some point version wise).

As far as I've noticed it does recreate symlinks by default, if the filesystem type on the other side permits this. For example, since vfat doesn't have such things, they cannot be recreated on a vfat fs and may throw this warning.

In this case, it may depend on how /mnt/mac-share was mounted, since presumably this is a network share. Again, as far as I've noticed this is okay with sshfs but may not be with something else, and may be subject to restrictions by the remote host.

goldilocks
  • 56,430
  • 17
  • 109
  • 217
  • okay, I think I set the Mac share mount up as **cifs** but I intend to put an external drive on the Raspberry Pi and rsync will probably probably play nice with that. I will take a look at **vfat**. Thanks for the answer. – Laust Jul 30 '16 at 19:06
  • I don't know if symlinks will work via cifs *but they definitely will not work with vfat* via cifs or otherwise, since as stated above "vfat doesn't have such things". You need a filesystem that *supports* symbolic links; ext and the native OSX format do, whereas Microsoft formats do not. – goldilocks Jul 30 '16 at 19:10
  • sorry, got vfat and sshfs mixed up there. I will look further into sshfs. ;) – Laust Jul 30 '16 at 19:25