LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-28-2014, 05:31 PM   #1
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
Another rsync --exclude thread!


Good day everyone.

I am currently attempting to use rsync to backup a full system onto a mounted external drive. Of course I do not want the mounted drive to be part of the backup, which would lead to infinite recursion, but so far I am unable to figure out how to properly write my --exclude to make it behave properly.

Code:
rsync -avh --exclude=exclude={'/dev/*','/sys/*','/proc/*','/tmp/*','/run/*','/mnt/*','/media/*','/lost+found/*'} / /mnt/external/backup
Unfortunately it seems to completely ignore my excludes. I've attempted using individual --exclude flags, removing the leading slash, and leaving off the explicit file declaration /*

I would be greatly appreciative of anyone who can point me in the right direction of where my code is incorrect.
 
Old 10-28-2014, 05:36 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,454

Rep: Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052
Try this syntax:
Code:
rsync -aAXv --delete /* /home/backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/.gvfs,/var/lib/ntp/proc/*,/home/*}
cut and paste (with some small changes) from the backup script on my home server.
 
1 members found this post helpful.
Old 10-28-2014, 06:15 PM   #3
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Original Poster
Rep: Reputation: 49
Thanks for the advice. What's strange for me is that your options works just fine from shell but not through a script. I'm sure it's a ' vs " expression problem. Thank you!

Last edited by Poetics; 10-28-2014 at 06:17 PM.
 
Old 10-28-2014, 06:30 PM   #4
Habitual
LQ Addict
 
Registered: Jan 2011
Posts: 8,245
Blog Entries: 11

Rep: Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287Reputation: 2287
show us the script please and tell us how it's being run.
 
  


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: exclude / include tux111 Linux - General 4 01-12-2014 01:54 AM
include and exclude in rsync xeon123 Linux - Newbie 4 05-26-2011 11:27 PM
rsync --exclude-from qns Lew Teng Han Linux - Newbie 3 01-17-2011 04:57 AM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 08:39 PM
rsync exclude list steelhead79 Linux - Software 3 01-14-2005 12:10 PM


All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration