NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
eton
Jan 22, 2011Luminary
rsync folder exclusion tips
I just would like to share my reasearch on how to exclude a folder with rsync.
The man pages uses the form FolderName/, but that excludes all folders with that name whereever they are stored on the bakup source.
I had a more simple wish; to exclude some specific folders from the backup source.
This works UPDATE: this method doesn't work anymore. Please look at new posts below for correct syntax.
The list is comma-separated. My media backup exclusion looks like this:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: How to access folders with spaces in their names on ReadyNAS/Infrant Linux. Example with a folder named "- FolderName":
More info in this thread: Step-by-Step: Rsync to Local USB (note that TeknoJnky's reply is wrong)
The man pages uses the form FolderName/, but that excludes all folders with that name whereever they are stored on the bakup source.
I had a more simple wish; to exclude some specific folders from the backup source.
This works UPDATE: this method doesn't work anymore. Please look at new posts below for correct syntax.
/FolderName/
The list is comma-separated. My media backup exclusion looks like this:
/c/media/BitTorrent/,/c/media/Temp/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: How to access folders with spaces in their names on ReadyNAS/Infrant Linux. Example with a folder named "- FolderName":
cd ./-\ FolderName/
More info in this thread: Step-by-Step: Rsync to Local USB (note that TeknoJnky's reply is wrong)
12 Replies
Replies have been turned off for this discussion
- etonLuminaryNote that path names with spacecs must be escaped. I.e. this folder name "nnn mmm" must be written "nnn\ mmm" in order to be accepted by rsync.
/dir/ means exclude the root folder /dir
/dir/* means get the root folder /dir but not the contents
dir/ means exclude any folder anywhere where the name contains dir/
Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
/dir means exclude any folder anywhere where the name contains /dir
Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
/var/spool/lpd//cf means skip files that start with cf within any folder
within /var/spool/lpd
http://articles.slicehost.com/2007/10/1 ... nd-folders - etonLuminaryI've had some problems with rsync for a while. My previous settings stopped working. So I've done a bit of research. Here are the results.
Source is: "Volume: c"
Excluded paths on destination:
Worksmedia/BitTorrent/,media/Temp/-\ Name/
Works/media/BitTorrent/,/media/Temp/-\ Name/
Doesn't workc/media/BitTorrent/,c/media/Temp/-\ Name/
Doesn't work/c/media/BitTorrent/,/c/media/Temp/-\ Name/
Kinda strange that absolute paths doesn't work (/c/media/BitTorrent/), but directories referenced with soft/symbolic links are accepted (/media/BitTorrent/).
In order to just view the symlinks:#ls / -la | grep ^l
- XAffiAspirantHi.
I have some issues with excluding files... I'd like to exclude hidden directories from my home share like .cache directory. How can i do this. /home/user/.cache cannot be entered into the web interfache.
Thanks. Norbert - etonLuminary
XAffi wrote: Hi.
I have some issues with excluding files... I'd like to exclude hidden directories from my home share like .cache directory. How can i do this. /home/user/.cache cannot be entered into the web interfache.
From my experience with the web interface is that it can be tricky. In most cases excluded directories should en with a slash, /home/user/.cache/. Does Frontview accept dots "."? You could try to escape the character with /home/user/\.cache/.
You can also try with character codes:
http://unix.stackexchange.com/questions/19829
http://www.ascii-code.com - XAffiAspirant
eton wrote: XAffi wrote: Hi.
I have some issues with excluding files... I'd like to exclude hidden directories from my home share like .cache directory. How can i do this. /home/user/.cache cannot be entered into the web interfache.
From my experience with the web interface is that it can be tricky. In most cases excluded directories should en with a slash, /home/user/.cache/. Does Frontview accept dots "."? You could try to escape the character with /home/user/\.cache/.
"/home/user/\.cache/" is not accepted by te web interface... Any idea if I can enter this directly? - etonLuminary
XAffi wrote: eton wrote: XAffi wrote: Hi.
I have some issues with excluding files... I'd like to exclude hidden directories from my home share like .cache directory. How can i do this. /home/user/.cache cannot be entered into the web interfache.
From my experience with the web interface is that it can be tricky. In most cases excluded directories should en with a slash, /home/user/.cache/. Does Frontview accept dots "."? You could try to escape the character with /home/user/\.cache/.
"/home/user/\.cache/" is not accepted by te web interface... Any idea if I can enter this directly?
Have you tried without the first slash (slightly different meaning but shouldn't make any difference in this case)? Like "home/user/\.cache/". I actually think rsync should handle dots fine, "home/user/.cache/". Be aware that it's case sensitive! - XAffiAspirant
eton wrote: XAffi wrote: eton wrote: XAffi wrote: Hi.
I have some issues with excluding files... I'd like to exclude hidden directories from my home share like .cache directory. How can i do this. /home/user/.cache cannot be entered into the web interfache.
From my experience with the web interface is that it can be tricky. In most cases excluded directories should en with a slash, /home/user/.cache/. Does Frontview accept dots "."? You could try to escape the character with /home/user/\.cache/.
"/home/user/\.cache/" is not accepted by te web interface... Any idea if I can enter this directly?
Have you tried without the first slash (slightly different meaning but shouldn't make any difference in this case)? Like "home/user/\.cache/". I actually think rsync should handle dots fine, "home/user/.cache/". Be aware that it's case sensitive!
Sorry for the late reply. had some issues with the ISP...
The web interface does not support this as well... Can you tell me where to edit it if login directly to the NAS? - etonLuminary
XAffi wrote:
Sorry for the late reply. had some issues with the ISP...
The web interface does not support this as well... Can you tell me where to edit it if login directly to the NAS?
I have a ReadyNAS Duo v1 with RAIDiator 4.1.13 firmware. Tried to find the file with rsync settings with:# find / \( -path /c -o -path /proc -o -path /USB \) -prune -o -type f -size -5k -exec grep -IHn '/media/BitTorrent/' {} 2>&1 \;But it finished with zero results.
Some research shows that RAIDiator/Frontview encodes paths and that most of Frontviews settings are stored under /etc/.# find /etc/ -type f -exec grep -IHn '%20Name' {} 2>&1 \;
/etc/cron.d/frontview-backup:1:5 04-23/24 * * mon,tue,wed,thu,fri root /frontview/bin/backup 001 enable 'local!!c!!!!!!!!' 'remote!!rsync!!localhost\%3A\%3AUSB\%5FHDD\%5F1!!!!!!' 'FIRST_TIME!!0!!0!!1!!0!!\%2Fmedia\%2FBitTorrent\%2F\%2C\%2Fmedia\%2FTemp\%2F\%2D\%5C\%20Name\%2F!!0' &> /dev/null
The selectable shares list for backup jobs is located here:/etc/frontview/rsync/Shares.conf
- XAffiAspirantThanks. I will check on my RN104.
- XAffiAspirantseems to be a little bit different on RN104.
I found in /etc/frontview the backup_jobs.conf file.
It has an "<opt_rsync_exclude>/home/user/cache.cache</opt_rsync_exclude>" entry, but it cannot be changed.... After change and save it will be changed back again... I will continue playing around with it.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!