LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Incremental backup software for a mixed environment (http://www.linuxquestions.org/questions/linux-server-73/incremental-backup-software-for-a-mixed-environment-700285/)

EarthAndAllStars 01-27-2009 02:55 PM

Incremental backup software for a mixed environment
 
I'm setting up a home server with Ubuntu 8.10 and I want backup software that does nightly backups of files located on shared folders. Some folders will be from Linux boxes, some will be Windows shares.

Any suggestions?

BrianK 01-27-2009 04:13 PM

If the folders are mounted on the machine that will hold the backups, you can simply use rsync & run it on a cron job.

something like:

Code:

rsync -ax --delete /source/mount/location/ /local/backup/location/sourcename_for_clarity/
will do the backup (note: trailing slashes have meaning. in this case, you're asking to sync everything inside, but not including "location" to everything inside but not include "sourcename_for_clarity")

then, to run it nightly, simply run "crontab -e" and add the rsync like so:

Code:

0 0 * * * rsync -ax --delete /source/mount/location/ /local/backup/location/sourcename_for_clarity/
which says (in order):
0 - the 0'th minute of the hour (i.e. 1:00 or 12:00 or 5:00)
0 - the 0'th hour of the day (i.e. midnight)
* - every day of the month
* - every month of the year
* - every day of the week

... so it will run at midnight, every day.

you can have several lines in one cron to do all backups like so:

Code:

0 0 * * * rsync -ax --delete /source/mount/location1/ /local/backup/location/sourcename_for_clarity1/
0 0 * * * rsync -ax --delete /source/mount/location2/ /local/backup/location/sourcename_for_clarity2/
0 0 * * * rsync -ax --delete /source/mount/location3/ /local/backup/location/sourcename_for_clarity3/

so, as a pratical example, if you had a windows share mounted to your linux machine as /mnt/windows/my_mp3s, the rsync cron might look like:

Code:

0 0 * * * rsync -ax --delete /mnt/windows/my_mp3s /home/EarthAndAllStars/backups/windows/

which would copy the directory /mnt/windows/my_mp3s and its contents into /home/EarthAndAllStars/backups/windows/, copying only changed data, deleting files in the backup location that have been deleted on the share, and maintaining all file information like timestamps and such.

This is all a "pull" from the backup machine. If you're looking for a push from the windows machine.. well.. maybe that's a question for WindowsQuestions.org. ;) (which is to say, I don't have a good answer that doesn't involve installing MS's UNIX Tools so that you get rsync & cron jobs).


All times are GMT -5. The time now is 11:51 AM.