Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-08-2007, 05:02 AM   #1
Registered: Sep 2005
Location: Notts, England
Distribution: Debian 6
Posts: 69

Rep: Reputation: 15
help with rsync exclude syntax please

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:

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:

#rsync -av --delete --exclude “.beagle” /home/J/  /mnt/nas/Test
with variations:
 -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?

Old 07-08-2007, 06:44 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
This works for me...
Old 07-08-2007, 01:23 PM   #3
Registered: Sep 2005
Location: Notts, England
Distribution: Debian 6
Posts: 69

Original Poster
Rep: Reputation: 15
Thanks homey,
it seems very strange but the commands work correctly now. In-between not working and working I did a yum update including a kernel update and reboot, and I got some sleep, so one of these things must have done the trick!?
Anyway it works now, so thanks for taking the time..


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync syntax for local copy hoover93 Linux - Software 3 12-21-2012 02:39 AM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 08:39 PM
can't get rsync exclude files Batta Linux - Newbie 1 03-27-2006 10:39 PM
rsync exclude list steelhead79 Linux - Software 3 01-14-2005 12:10 PM
Using the exclude option absolutely with rsync karlovac Programming 0 03-01-2004 12:39 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration