Thursday, February 21, 2008

Using date in file name (and compressing files)

Yea this is stupid an easy, and also very annoying if you forget how!

    backup=`date +%Y%m%d`
tar czvf SQL-$backup.tar.gz *.sql
That backs up all the current .sql files in a directory into a file with todays date as the name

No comments: