LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 03-03-2009, 01:45 AM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Rep: Reputation: 54
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: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
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
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Original Poster
Rep: Reputation: 54
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: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
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



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
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:16 AM.

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
Open Source Consulting | Domain Registration