rsync, rsync, rsync. That's all the OP needs. It's fast, efficient, smart, free, open source, multi-os (even Cygwin).
Here's my core rsync script I use on all my developer instances Linux and Windows, pay attention to whether you need a trailing slash in the paths:
Code:
#!/bin/sh
#[Note: This is a FULL system backup script and requires root. If you
# only want to backup your user files then tailor the script.]
# Use "sudo crontab -e" to set up a cron job to run it.
#
#[Note: --delete will remove target files and dirs that no longer exist in
# the source, you may or may not want this sync'ing.]
#
#[Note: The first backup will take a while, to add the files to the
# target, after that it should only take a matter of minutes.]
#
#[Note: rsync must be installed on the source and the target.]
#
BINPRE="rsync -r -t -p -o -g -v -l -D --delete"
SSH="-e ssh -p 22"
BINPOST="<target_user>@<target_host_ip>:/<target_backup_dir>"
EXCLUDES="--exclude=/mnt --exclude=/tmp --exclude=/proc --exclude=/dev "
EXCLUDES=$EXCLUDES"--exclude=/sys --exclude=/var/run --exclude=/srv "
EXCLUDES=$EXCLUDES"--exclude=/media "
date >> /root/start
$BINPRE "$SSH" / $EXCLUDES $BINPOST
date >> /root/stop
This is how I backup my MySQL and Postgres databases:
Code:
# mysql
/usr/bin/mysqldump -u root -ppassword --all-databases | gzip > /root/databasebackups-mysql/database_"`date | tr \" \" \"-\"`".sql.gz
# postgresql - this expects a ~/.pgpass file to be present
/usr/bin/pg_dumpall -h localhost -U postgres | gzip > /root/databasebackups-postgres/database_"`date | tr \" \" \"-\"`".sql.gz