PDA

View Full Version : How do you manage all your local & FTP backups?



tizwoz
8th September 2006, 12:21 PM
Not an area that I ever went to in Windows but it's something I want to look into and do on linux.

I know someone (who's a windows user) who backs up all this files (ftp & local) by using netdrive & robocopy. He just runs a script and this bot connets to ftp and backups everything.

Something that I should add, robocopy works very uniquely. It looks at the files and it only updates and saves the changed & new files instead of overwriting the whole lot, thus saving a heck of a lot of time.

What's available for linux? What do you guys use? :)

huw-l
8th September 2006, 01:04 PM
you might want to take a look at rdiff-backup

http://www.nongnu.org/rdiff-backup/

there are other backup systems like bacula and amanda but they are probably massive over-kill for what you want.

tizwoz
8th September 2006, 01:20 PM
Cheers for that, will look into it now...



there are other backup systems like bacula and amanda but they are probably massive over-kill for what you want.

Would they tho?

I want would them to backup 4 websites (via ftp) to my laptop hdd. Then backup everything from my laptop hdd to an external hdd.

If rdiff will do the job for that, then that would do me :) Ideally, I would love to get something working the same as robocopy does on windows, but if not, it'll be fine to do it the standard way.

pparks1
8th September 2006, 01:33 PM
rsync in linux works very much the same as robocopy. It only copies the changes and is thus very fast. In addition, it can sync both the source and destination (like the MIR switch of robocopy). Therefore, if you delete a file from the machine, it will also get deleted from your backup. Just do a search here or on Google for rsync.....you will be glad that you did.

I use a program called rsnapshot. http://www.rsnapshot.org/ It's based on rsync. It runs a backup job every 4 hours (so I get 6 backup points during the day), it backs up each day for the past 7 days and I have the end of a week (from Sunday night) for 4 weeks. It uses links to handle files that haven't changed since the last backup, so it doesn't chew up massive amounts of diskspace. I have it automated through cron and thus far it has never failed me.

huw-l
8th September 2006, 01:35 PM
from the way you have described robocopy rdiff-backup will behave almost identically. With the added bonus that you get versioning as well as latest copy.

tizwoz
8th September 2006, 01:47 PM
rsync in linux works very much the same as robocopy. It only copies the changes and is thus very fast. In addition, it can sync both the source and destination (like the MIR switch of robocopy). Therefore, if you delete a file from the machine, it will also get deleted from your backup. Just do a search here or on Google for rsync.....you will be glad that you did.

I use a program called rsnapshot. http://www.rsnapshot.org/ It's based on rsync. It runs a backup job every 4 hours (so I get 6 backup points during the day), it backs up each day for the past 7 days and I have the end of a week (from Sunday night) for 4 weeks. It uses links to handle files that haven't changed since the last backup, so it doesn't chew up massive amounts of diskspace. I have it automated through cron and thus far it has never failed me.

That sounds EXACTLY what I'm looking for :) :) :) :) :)

I will check out both tho, again thankyou, thank you. I didn't think it would exist for linux. Linux always seems to surprise me lately, it's not as bad as everyone* makes out, it's better!!

*Windows users :D I've got a fella who is adament robocopy won't exist on linx (he hates linux), can't wait to shove this up this jacsky :D

tizwoz
10th October 2006, 09:29 AM
I had quite a bit of trouble getting rsnapshot to work, so I went to use rdiff-backup. Seems to have worked, took 10 hours to complete for my first initial backup to an ext hdd.

I went to run it again using the command: rdiff-backup --print-statistics /home/tizwoz/ /media/disk-1/Laptop and I thought it would just run thru and backup the new file that I had since placed in my home directory.

So far it's been on 4 hours and appears to me to be doing a full backup again! :S I want this to run the same way as robocopy so it'll just update the changed / new files instead of a complete backup to every time. Am I missing a [option] in the script? I've read the r-diff homepage but I can't seem to find what i'm looking for (if it does exist).

Does rsnapsho work the same way as this? I might try and bury my head in it to try and get it working. Atm my backups just aren't as easy as I'd like them to be :(

gthill
10th October 2006, 09:45 AM
$rsync -avz /home/tizwoz /media/disk-1/Laptop

This will require only one full pass and then all subsequent backups will only transfer the changed files

read the man pages for other options

$man rsync

pete_1967
10th October 2006, 10:56 AM
Since you're talking about websites, best solution is to use CVS or Subversion for all code, and only use backup script to backup stuff you haven't developed/ uploaded (e.g. user submitted images).

tizwoz
10th October 2006, 12:38 PM
$rsync -avz /home/tizwoz /media/disk-1/Laptop

This will require only one full pass and then all subsequent backups will only transfer the changed files

read the man pages for other options

$man rsync

Great! Just what I need. I tried that but I got this error back :confused:

bash: -avz: command not found


I've had a look in yumex for rsync to see if I was missing any files / libarys etc, can't see out there. Am I missing a patch for it or something? :confused:

gthill
10th October 2006, 01:29 PM
First check that you have rsync installed, use
rpm -qa rsync
This should return something like this
rsync-2.6.8-1.FC5.1
if nothing is returned you need to install rsync, use
yum install rsync
now try the command again
rsync -avz /home/tizwoz /media/disk-1/Laptop

Have you looked at the man pages, use
man rsync

tizwoz
10th October 2006, 03:27 PM
Sorted - cheers!! :) :)

huw-l
11th October 2006, 05:54 PM
hmmm, rdiff-backup in fedora-extras seems to be 1.0 not 1.1 which might be the problem.

not that it matters as rsync seems to be working for you.

tizwoz
11th October 2006, 05:59 PM
Yup! Works a treat, really pleased with the way i've got me backups now. Thanks again, be lost without you guys, lol :D

pdb
12th October 2006, 12:37 AM
I didn't think it would exist for linux. Linux always seems to surprise me lately, it's not as bad as everyone* makes out, it's better!!

*Windows users :D I've got a fella who is adament robocopy won't exist on linx (he hates linux), can't wait to shove this up this jacsky :D
Just a random side-note based on your comment: I love all the little tools available on Linux. It makes it possible to cobble something together to do whatever you want. Even better, the culture around the OS means someone probably already tried to do what you did, found or made a solution, and posted it somewhere on the internet for the world's benefit. :)