Generational Backups
A while back I was asked for a script which would ftp a tarball to a server and provide support for multiple generations. Here's my first attempt:
HOST='192.168.254.254' USER='us4rn4m3' PASSWD='p4ssw0rd' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD binary delete backup4.tar rename backup3.tar backup4.tar rename backup2.tar backup3.tar rename backup1.tar backup2.tar rename backup0.tar backup1.tar put /usr/tmp/backup.tar backup0.tar quit END_SCRIPT exit 0
Did the job, but it's rudimentary to say the least.
It wasn't long before I was asked to alter the number of generations, and there were other issues. So I wrote a better script, which I've posted in the hope some may find it useful





