LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-25-2003, 08:42 PM   #1
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Rep: Reputation: 30
rsync backup...


Rsync question here...

I was curious if anyone knew how to setup a rsync job that would only backup certain directories within a certain partition?

For instance, I have a partition on my linux server that has about 15 directories in out. I want to run a rsync backup job that will only backup certain directories on it...

I know this can be done using include/exclude, but im having a little trouble figuring it out...

Anyone have any suggestions?

Thanks.

Tarballed
 
Old 06-26-2003, 01:25 AM   #2
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
The man page has a pretty clear list of rules. What are the problems you are having?
 
Old 06-26-2003, 11:44 AM   #3
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Original Poster
Rep: Reputation: 30
Well, what Im trying to do is have rsync backup selected directories and ignore the other directories.

I was flipping through the rsync man page, but was having a hard time figuring out just how to specify certain directories.

Any ideas?

Tarballed
 
Old 06-26-2003, 12:03 PM   #4
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
How about specifying them in a file and using, as you say "exclude".

From the man page:

--exclude-from=FILE exclude patterns listed in FILE

Try a small directory as a test, excluding a subdirectory. Just the the directory in the file to "specify" it. If that does not work, repost what you tried, what you expected, and what you got.
 
Old 06-26-2003, 12:21 PM   #5
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Original Poster
Rep: Reputation: 30
Ok, here is what I am attempting to do:

rsync -rv --include-from=/root/rysncfile /backupstorage/D/ /backupstorage/rsync

Here are the contents of the rsyncfile:

/backupstorage/D/CLOSED/
/backupstorage/D/declines/
/backupstorage/D/LEADS/
/backupstorage/D/"My Documents"/
/backupstorage/D/PERSONAL/
/backupstorage/D/PNTDATA/
/backupstorage/D/PNTTEMPL/
/backupstorage/D/PRIVATE/
/backupstorage/D/TDS03/

I thought I would go with includes to specify the directories specifically.

Any thoughts or input? Im running a "dry run" as I write this.

Tarballed
 
Old 06-26-2003, 12:35 PM   #6
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Original Poster
Rep: Reputation: 30
Ok, im doing something wrong. I tried specifying a file for includes and excludes and it still is backing up the entire directory.

I must be specifying it incorrectly in the file.

It still backups up the entire /backupstorage/D.

ANy ideas?

Tarballed
 
Old 06-26-2003, 04:41 PM   #7
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Original Poster
Rep: Reputation: 30
Ok. This where im at.

If I specify my excludes at the command line, it works correctly.

However, I cannot seem to get it to work correctly if I put it into a file.

I used the following command:

rsync -av --exclude-from=exclude.conf /backupstorage/D/ /backupstorage/rsyncbackup

It's running a backup off the local machine, so its just copying data from one location to another, but doing incremental...

Any ideas?

Tarballed
 
Old 06-26-2003, 05:01 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If you add another "v" to increase the verbosity you will see if the exclude file list is loaded (near the start of the output)
 
Old 06-26-2003, 05:10 PM   #9
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Original Poster
Rep: Reputation: 30
Alright. I figured it out.

After doing reading and testing, this is what I found.

Obviously, include is set by default. So it will automatically grab everything.

What I did was create a script and put all the direcotires I wanted not to be backed up in there. I also had the incorrect syntax in the file...instead of the full path, it should be:

/<FOLDER/

I had the full path which was messing it up.

Tarballed
 
Old 06-26-2003, 10:00 PM   #10
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
Glad you got it licked :-) Sometimes the man pages only make sense after one knows the information they provide. For example, as you discovered about the behaviour of include is stated succinctly in the manpages thus:

--include=PATTERN donīt exclude files matching PATTERN
--include-from=FILE donīt exclude patterns listed in FILE

So an include works only to negate an exclude. The EXCLUDE OPTIONS section is interesting: one can build some quite complicated formulas for backup/copying. You have inspired me to try some things out, thanx.
 
Old 06-27-2003, 10:43 AM   #11
tarballed
Member
 
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326

Original Poster
Rep: Reputation: 30
Ya, rsync is very very cool. I am planning on using it more on my network here. I feel it has a lot of potential.

For now, im going to backup those directories on my server, and then use SSH to put them on another server to safety sake...

When im done, I will put the full script and setup here on this page.

Tarballed
 
  


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 12:34 AM
automated backup with cygwin and rsync hoover93 Linux - Networking 1 07-06-2005 08:35 PM
rsync incremental backup sachin_keluskar Linux - Software 1 06-29-2005 02:09 AM
rsync as backup? ziggie216 Linux - Software 3 03-13-2005 02:22 PM
Rsync backups - how not to backup TV recordings jamespetts Linux - Software 0 11-20-2004 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:05 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