Backups ... properly

Posted by ads' corner on Wednesday, 2006-08-09
Posted in [Other-Dbs][Software][Stupid]

Today I found this little script which does backups on a server:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/bin/bash

cd /home/Backup/

DATE=`/bin/date "+%d.%m.%y"`

WEB="web-($DATE).tar"
SQL="sql-($DATE).tar"

tar -cvf "$WEB" /var/lib/mysql
tar -cvf "$SQL" /var/www

exit 0

Ok, let me count:

  1. no check, if the cd fails

  2. no compression used

  3. no errorchecking at all for the tar (disk full as example)

  4. copying the open database files is always a bad idea[tm], mysqldump exists

  5. and now check out, which variable name is used for which backup …

Wonder if anyone ever tested a restore …


Categories: [Other-Dbs] [Software] [Stupid]
Tags: [Backup] [Mysql] [Software] [Stupid]