Automatic backups

Well, I’ve never made any bash scripts before, but I saw, and it seemed a bit funny. I didn’t think all of the steps seemed entirely logical. I played around with it and this is how my file ended up (my goal being to keep copies of the file and db in a folder that is already made until I manually delete them). Any of the more experienced people out there have any thoughts/opinions?

suffix=$(date +%y%m%d)
tar -c /home/USERNAME/.snapshot/nightly.0/ | gzip -c > archives/DOMAIN-$suffix.tar.gz
mysqldump --opt --user=“DBUSERNAME” --password=“DBPASSWORD” -h DBNAME | gzip -c > archives/DOMAINdb-$suffix.sql.gz

Check out Gordaen’s Knowledge, the blog, and the MR2 page.