LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-27-2006, 08:02 AM   #1
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
anyone use rsync?


I built a small server to backup my laptop and my wife's laptop. I'm running Slackware 10.2 on both and her laptop runs XP so I setup samba to share windows like so she could access the backups. I smb mount /home/enine from the remote server then use rsync to copy the data from /home/enine on my laptop over.
Odd problem i'm having is when using the --delete option any files I delete on my laptop under subdirectories under /home/enine gets deleted on the server but nothing in /home/enine gets deleted. I typically copy everything to /home/enine be it downloads, or files copied from a digicam or scans, then sort/rename/convert/whatever and then move them to where they need to be so if I do a backup in between I end up with a lot of old files sitting on my /home/enine on my server. Anyone know why it wouldn't delete in the top level folder but works fine under.
Also do you have any suggestions on how to rsync but not delete files for a certain length of time to sort of give a buffer if I delete/rename/change something I didn't want to.
 
Old 03-27-2006, 08:43 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

I just suggest you take a look at rdiff-backup. It's a program that most distros have, probably Slackware too.

It uses rsync to do the backups, but has no problem with delete, and also has a rollback feature so you can set it up so it will store diff files in a special directory called rdiff-backup-data and those diffs can be used to recreate the filesystem after you have "rsynced" a a backup with --delete.

I think the program is really neat, much better backups than a regular rsync one.

Best regards,
Guttorm.
 
Old 03-27-2006, 09:33 AM   #3
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Debian
Posts: 88

Rep: Reputation: 15
You would need to post your command & config file.

However, consider using cwrsync (free rsync for Windows), which will allow you to use rsync's checksumming feature to only transfer those parts of a file that have changed. Rsync'ing a mounted drive is an ugly solution.

http://itefix.no/cwrsync

Steve
 
Old 03-27-2006, 10:25 AM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by enine
Also do you have any suggestions on how to rsync but not delete files for a certain length of time to sort of give a buffer if I delete/rename/change something I didn't want to.
I do something like the below example. My rotation scheme is backup-count-based, not time-based, but you could modify that if you desire. I actually have a long-winded PERL script that does this, so I extracted just the minimum code to illustrate what I do. Since I manually extracted code from PERL and retyped it into a functionally similar shell example (hopefully!), I have not specifically tested the example below. It's for illustration purposes only. You have been warned!
Code:
$ su
# source=/home/whatever
# destination=/mnt/backup
# mount -o remount,rw $destination
# rm -rf $destination/snapshot.3 2>/dev/null
# mv $destination/snapshot.2 $destination/snapshot.3 2>/dev/null
# mv $destination/snapshot.1 $destination/snapshot.2 2>/dev/null
# mv $destination/snapshot.0 $destination/snapshot.1 2>/dev/null
# rsync --one-file-system \
        --archive \
        --safe-links \
        --delete \
        --delete-after \
        --delete-excluded \
        --link-dest="$destination/snapshot.1" \
        --filter="merge /usr/local/etc/rsync.d/rsync-filter" \
        --filter="dir-merge /.rsync-filter" \
          "$source/" \
          "$destination/snapshot.0/"
# touch $destination/snapshot.0
# mount -o remount,ro $destination
# exit
$
 
Old 03-27-2006, 11:18 AM   #5
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486

Original Poster
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by essdeeay
You would need to post your command & config file.

However, consider using cwrsync (free rsync for Windows), which will allow you to use rsync's checksumming feature to only transfer those parts of a file that have changed. Rsync'ing a mounted drive is an ugly solution.

http://itefix.no/cwrsync

Steve
If its rsync for windows then wouldn't I need windows at the server side?
 
Old 03-27-2006, 01:11 PM   #6
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Debian
Posts: 88

Rep: Reputation: 15
No, cwrsync for Windows uses some cygwin dlls, the only thing you have to be careful of is in the config file, the way you express / or \
 
Old 03-27-2006, 01:57 PM   #7
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486

Original Poster
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
yea, it looks like the trailing / tells it to delete in the parent folder. Obscure option I didn't see.
I'm backing up to a linux server not windows, I'm just running samba to my wife's Xp box can access my files if needed (read only so no windows virus can wreck anything)
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync knowkontrol Linux - General 4 10-23-2005 03:08 PM
rsync help dc6463 Linux - Software 0 10-14-2004 10:08 AM
what is rsync? ilnli Linux - Networking 1 10-13-2004 03:30 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
rsync slack66 Slackware 1 07-29-2003 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:09 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
Open Source Consulting | Domain Registration