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 03-29-2006, 07:30 PM   #1
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: Suse 10
Posts: 206

Rep: Reputation: 30
backup folder (rsync)


hi

i try to backup my home folder with rsync...

in a script i have

Code:
#!/bin/sh
# directory to backup
BDIR=/home/$USER

# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=exclude.txt

OPTS="-a -r -v --exclude-from=$EXCLUDES"

# the name of the backup machine
BACKUPDIR=/tmp/test_rsync

# now the actual transfer
rsync $OPTS $BDIR $BACKUPDIR
i try to exclude some folde and all sub-directory...

in my exclude.txt i have
+ /home/collinm/mp3
+ /home/collinm/Download

when i run the script, rsync copy all file .... it copy mp3 and Download folder..... but i don't want that....

any idea?

thanks
 
Old 03-29-2006, 09:17 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,248

Rep: Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558
I don't have the computer on which I have installed rsync at hand, so just two wild guesses:

1. "+" in front of a rule usually means that the path is INcluded. Now I don't know if "+" in an EXclude file means exclude, or include. Intuitively I would say that in an exclude file reverse logic is true. However, just try the path without "+" and preceeded with "-"

2. When rsync descends into directories, the rule must still be true. That means that the path /home/collinm/mp3/hardrock does NOT match the rule /home/collinm/mp3. You would have to specify the rule as /home/collinm/mp3/* Only then every subdir matches your rule.

Good luck, and sorry if I am wrong.

jlinkels
 
Old 03-29-2006, 09:20 PM   #3
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: Suse 10
Posts: 206

Original Poster
Rep: Reputation: 30
i tried with "+", "-" and nothing and get the same result
 
Old 03-29-2006, 09:21 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
An "exclude file" defaults to the "-" operation if it is not specified whereas an "include file" defaults to "+". However, you can make an exclude file behave like an include file by prefacing the lines with a "+". This is exactly what you did. The converse is also true for an include file with "-" lines in it (this would behave like an exclude file).

Do not put those "+" signs in your exclude file.

Replace:
Code:
+ /home/collinm/mp3
+ /home/collinm/Download
with this:
Code:
/home/collinm/mp3
/home/collinm/Download
 
Old 03-29-2006, 10:07 PM   #5
os2
Member
 
Registered: Dec 2003
Location: Canada
Distribution: Suse 10
Posts: 206

Original Poster
Rep: Reputation: 30
mp3/
Download/

work fine with that....
 
  


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
RAID 1 or RSYNC BACKUP otagojo Linux - General 7 08-01-2005 01:34 AM
rsync incremental backup sachin_keluskar Linux - Software 1 06-29-2005 03:09 AM
rsync as backup? ziggie216 Linux - Software 3 03-13-2005 03:22 PM
backing up remote folder with rsync and ssh ohcarol Linux - Software 6 01-03-2005 01:43 AM
rsync backup... tarballed Linux - Networking 10 06-27-2003 11:43 AM


All times are GMT -5. The time now is 06:14 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration