LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-18-2007, 06:02 AM   #1
alexpacio
LQ Newbie
 
Registered: Apr 2006
Posts: 23

Rep: Reputation: 15
Exclamation 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!!
 
Old 07-18-2007, 06:37 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
rsync --exclude=.tib --exclude=.bkp -avH /mnt/raid5/ /mnt/backup/

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

Last edited by macemoneta; 07-19-2007 at 05:22 PM.
 
Old 07-19-2007, 04:36 PM   #3
alexpacio
LQ Newbie
 
Registered: Apr 2006
Posts: 23

Original Poster
Rep: Reputation: 15
I will try....

Thank you..
 
Old 07-22-2007, 07:19 PM   #4
alexpacio
LQ Newbie
 
Registered: Apr 2006
Posts: 23

Original Poster
Rep: Reputation: 15
Hi,
the exclude syntax doesn't work again...Rsync doesn't exclude files with "tib" (and "bkp")extension as required by me...
 
Old 07-22-2007, 07:34 PM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
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
 
Old 07-23-2007, 07:27 PM   #6
alexpacio
LQ Newbie
 
Registered: Apr 2006
Posts: 23

Original Poster
Rep: Reputation: 15
Yes!
Now the command works correctly!
Thank you so much!
 
  


Reply


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 Off
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 03:39 AM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 06:40 AM
help with rsync exclude syntax please JacekZ Linux - General 2 07-08-2007 02:23 PM
C++ syntax question jiml8 Programming 6 06-20-2006 05:19 PM
rsync Syntax Question for Connecting to Remote Windows Machine Linux31 Linux - Networking 3 10-09-2005 03:55 PM


All times are GMT -5. The time now is 09:21 PM.

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