LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 03-03-2009, 01:45 AM   #1
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 652

Rep: Reputation: 33
help with rsync exclude files


I'm trying to figure out how to exclude certain folders but I'm finding little to no information online on how exclude files worked.

I'm trying this to no avail:

Code:
+ **/saves/**
Also tried with just one *. I want to skip any folder that is called /saves/.

Also when I enter a full path, what is the context of the path?

Like if I do rsync -vru /data/ /source

What do I put if I want to exclude /data/folder/ do I put just /folder/ or do I put /data/folder?

I spent hours searching and it seems this is an undocumented feature of rsync.

Also, how do I force it to delete folders if it gets deleted in the source? I just get "cannot delete non empty directory" errors. Tried --force no luck.
 
Old 03-03-2009, 02:12 AM   #2
speck
Member
 
Registered: Nov 2001
Location: California
Distribution: Slackware 14.1
Posts: 271

Rep: Reputation: 54
I use an exclude file instead of specifying them on the command line.

Contents of rsync_exclude.txt:
Code:
/mnt/floppy/
/proc/
/sys/
/tmp/
Code:
rsync -av --delete --exclude-from=/home/speck/scripts/rsync_exclude.txt / /mnt/ext_drive/backup/
 
Old 03-03-2009, 02:25 AM   #3
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 652

Original Poster
Rep: Reputation: 33
That's what I'm doing, just not sure the syntax.

So is it just a list of full paths with return, or is it relative paths to the backup source?
 
Old 03-03-2009, 10:12 AM   #4
speck
Member
 
Registered: Nov 2001
Location: California
Distribution: Slackware 14.1
Posts: 271

Rep: Reputation: 54
That's the exact syntax from my backup script, so it's full paths (including the trailing slash). You can add the "-n" option (rsync -n -av --delete) to test your command, just in case.
 
Old 03-03-2009, 10:54 AM   #5
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Quote:
Originally Posted by Red Squirrel View Post
I'm trying to figure out how to exclude certain folders but I'm finding little to no information online on how exclude files worked.

I'm trying this to no avail:

Code:
+ **/saves/**
Also tried with just one *. I want to skip any folder that is called /saves/.

Also when I enter a full path, what is the context of the path?

Like if I do rsync -vru /data/ /source

What do I put if I want to exclude /data/folder/ do I put just /folder/ or do I put /data/folder?

I spent hours searching and it seems this is an undocumented feature of rsync.

Also, how do I force it to delete folders if it gets deleted in the source? I just get "cannot delete non empty directory" errors. Tried --force no luck.
You are kidding right?

Here is the first link from Google "man rsync" which explains excludes in great detail.

http://www.manpagez.com/man/1/rsync/
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude function On rsync command its_joy Linux - Server 5 01-18-2008 04:25 AM
help with rsync exclude syntax please JacekZ Linux - General 2 07-08-2007 01:23 PM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 08:39 PM
can't get rsync exclude files Batta Linux - Newbie 1 03-27-2006 10:39 PM
rsync exclude list steelhead79 Linux - Software 3 01-14-2005 12:10 PM


All times are GMT -5. The time now is 04:55 AM.

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