Using rsync to sync two folders across a network
Is there an easy way to sync-up the /web (where my wwwdata is kept) folders in there? I was thinking rsync, but any type of automated solution would be good.
The only real issue I can think of is that i have a few symbolic links in there, in order to make it easy for someone to keep webspace in their home folder.
Also, what's the command to setup a cron to backup the DB daily, bzip2 it, and name it "dbbackup4-21.bz2, dbbackup4-22.bz2" etc etc etc.
Thanks
Jay
1 Reply
DESTDIR=/backup/root/`date "+%Y-%m"`
FILENAME=dbbackup-`date "+%Y-%m-%d-%H%M"`.tgz
mkdir -p ${DESTDIR}
tar -C ${SRCROOTDIR} -czpf ${DESTDIR}/${FILENAME} ${SRCDIR}
You can do the necessary changes for bzip compression instead of gzip, but that should get you going.