Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- date
- echo "############### Backing up files on the system... ###############"
- backupfilename=server_file_backup_`date '+%Y-%m-%d'`
- echo "----- First do the sql by deleting the old file and dumping the current data -----"
- rm -f /tmp/backup.sql
- mysqldump --user=mysqluser --password=password --all-databases --add-drop-table > /tmp/backup.sql
- echo "----- Now tar, then zip up all files to be saved -----"
- tar cvf /directory/to/store/file/${backupfilename}.tar /home/* /var/www/html/* /usr/local/svn/* /etc/php.ini /etc/httpd/conf/httpd.conf /tmp/backup.sql /var/trac/*
- gzip /directory/to/store/file/${backupfilename}.tar
- rm /directory/to/store/file/${backupfilename}.tar
- chmod 666 /directory/to/store/file/${backupfilename}.tar.gz
- echo "############### Completed backing up system... ###############"
- date
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement