BreadCrumbs: Server Backup
Server Backup
From Luke Jackson
(Difference between revisions)
Revision as of 15:40, 3 July 2007 (edit) Ljackson (Talk | contribs) ← Previous diff |
Revision as of 15:42, 3 July 2007 (edit) Ljackson (Talk | contribs) (→Linux) Next diff → |
||
Line 6: | Line 6: | ||
Simply copy one of the scripts below into a file in the '''/etc/cron.weekly''' directory. | Simply copy one of the scripts below into a file in the '''/etc/cron.weekly''' directory. | ||
+ | |||
+ | == Scripts == | ||
+ | |||
+ | Various backup scripts for different configurations. | ||
=== Named (Bind), Apache, MySQL, Postfix, WWW Data === | === Named (Bind), Apache, MySQL, Postfix, WWW Data === |
Revision as of 15:42, 3 July 2007
Contents |
Windows
Linux
Cron
Simply copy one of the scripts below into a file in the /etc/cron.weekly directory.
Scripts
Various backup scripts for different configurations.
Named (Bind), Apache, MySQL, Postfix, WWW Data
Below is a simple backup script which saves the configuration files for the following applications:
- Named (Bind)
- Apache
- MySQL
- Postfix
Note: It is assumed that the default install paths have been used and all web contend has a base of /www
Shell Script
#! /bin/sh TODAY=`date +%m_%d_%Y` SERVER=domain.ext cd /home/juser/backups/ ### Backup Apache Config ### tar zcvf $SERVER.httpd.tar.gz /etc/httpd/ >>/dev/null echo "Completed Apache Config Backup on $SERVER for $TODAY......" #### Backup Named Config #### tar zcvf $SERVER.named.tar.gz /var/named/ >>/dev/null echo "Completed Named Config Backup on $SERVER for $TODAY......" #### Backup Postfix Config #### tar zcvf $SERVER.postfix.tar.gz /etc/postfix/ >>/dev/null echo "Completed Postfix Config Backup on $SERVER for $TODAY......" ### Backup MySQL Server ### mysqldump --user=mysqlbackup --password=backup --all-databases | gzip -c > $SERVER.sql.gz echo "Completed MySQL Server Backup on $SERVER for $TODAY......" ### Backup Data ### tar zcvf $SERVER.server.tar.gz /www/ >>/dev/null echo "Completed Data Backup on $SERVER for $TODAY....."