LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Rsync syntax question (https://www.linuxquestions.org/questions/linux-software-2/rsync-syntax-question-570345/)

alexpacio 07-18-2007 05:02 AM

Rsync syntax question
 
Hi,
I have to backup a Raid5 volume (mounted as a normal directory of the "/" filesystem) on an another disk used for backups.

I thought to backup it with rsync, excluding some type of file and preserving permissions.

But the command I made doesn't work...

(Must be excluded files with .tib and .bkp extension)

here is the command:

rsync --exclude="*.tib" "*.bkp" -avhp /mnt/raid5/ /mnt/backup/

Could you correct it??

please help me!!:cry: :cry:

macemoneta 07-18-2007 05:37 AM

rsync --exclude=.tib --exclude=.bkp -avH /mnt/raid5/ /mnt/backup/

Update: I just noticed that the 'h' was lowercase; it should be uppercase.

alexpacio 07-19-2007 03:36 PM

I will try....

Thank you..

alexpacio 07-22-2007 06:19 PM

Hi,
the exclude syntax doesn't work again...Rsync doesn't exclude files with "tib" (and "bkp")extension as required by me...

macemoneta 07-22-2007 06:34 PM

The pattern needs a leading asterisk:

Code:

$ mkdir source
$ mkdir dest
$ touch source/file1.tib
$ touch source/file2.bkp
$ touch source/file2.txt
$ rsync --exclude=*.tib --exclude=*.bkp -avH source/ dest/
building file list ... done
./
file2.txt

sent 143 bytes  received 48 bytes  382.00 bytes/sec
total size is 0  speedup is 0.00


alexpacio 07-23-2007 06:27 PM

Yes!
Now the command works correctly!
Thank you so much!


All times are GMT -5. The time now is 12:14 AM.