Results 1 to 3 of 3
Hey!
I run some backup scripts using rsync and in order to cut down on the filesize, I only want to backup the files with certain extensions (ie .bmp/.jpg/.css etc...).
...
- 04-23-2008 #1Just Joined!
- Join Date
- Apr 2008
- Posts
- 1
rsync - including only certain extensions
Hey!
I run some backup scripts using rsync and in order to cut down on the filesize, I only want to backup the files with certain extensions (ie .bmp/.jpg/.css etc...).
My question is that if I use --include *.bmp will I have to use --exclude *.* (or something) too? After reading the man pages I'm just a little confused!
Does anyone know of a way to get this done?
Thanks a lot
- 04-24-2008 #2
i would recommend scp cause its secure.
- 04-28-2008 #3Just Joined!
- Join Date
- Sep 2007
- Location
- Lafayette, IN
- Posts
- 83
For local copying, it doesn't matter. For remote copying you can tell rsync to use SSH with the -e flag, like this:
To answer the original question, you can do something like this:Code:rsync -e /bin/ssh
In my example, the directory 1 has files named a.yes, a.no, b.yes, b.no, etc. When the above command is run, only the *yes files get copied. Take note: rsync cares what comes first. If you put the exclude first, nothing gets copied.Code:rsync -av --include="*yes" --exclude="*" -n 1/ 2/


Reply With Quote

