I've reviewed the rsync man and info pages, and although they explain the exclude option to some extent, I'm struggling to make the option work. Most of yesterday in fact.
I currently back up my home user directory to a consumer network attached storage (nas) device using the command:
Code:
rsync -av --delete /home/J/ /mnt/nas/Pc1
that works OK but very slowly - the nas only interfaces through samba on it's side, so rsync (probably) doesn't run there - only on my local pc. I mention that in case it introduces some complications to the question at hand.
Because it's slow I want to be able to sometimes only back up certain directories. The setting that is causing me problems is when I wish to back up ALL the hidden folders and files (e.g. '.beagle' '.bluefish' etc.) in one go, without backing up my normally visible directories where I keep documents (called '/Docs') and pictures (called '/Pictures') etc. There are far fewer visible folders than hidden folders, so the sensible way would seem to be to exclude the minority set (the visible folders) from the mass-backup of the home directory. But all the permutations of the exclude command that I've tried have failed.
Because rsync starts the backup with the hidden folders in alphabetical order the easiest way to test on my system is by excluding just the '.beagle' folder from the full run. That's not the folder I actually want to exclude in the end, but it makes for easiest testing if I assume it were the one to exclude. So the commands I've tried are:
Code:
#rsync -av --delete --exclude “.beagle” /home/J/ /mnt/nas/Test
with variations:
Code:
-exclude “.beagle”
--exclude “.beagle”
--exclude=“.beagle”
--exclude “/.beagle”
--exclude “.beagle/”
--exclude “/.beagle/”
--exclude “/*.beagle/*”
--exclude “/**.beagle/**”
--exclude “.beagle/***”
and all the permutations of the above variant elements that I could think of
Can anyone advise how I should express the exclude statement so that the .beagle directory, all its files, all its sub directories and all the files in them, get skipped from the backup please?
Thanks
Jacek