Friday, 14 May 2004
I've been managing 40ish installs of Directadmin since a year now, and although the control panel has a great backup system built in for users and resellers, we always make a backup every night to move it to an external server over the 2nd network interface..
Take into account that you'll need a current tar binary, else you'll need to split up the /home backup dir alphabetically (the older tar files are limited to 4GB)
Make a backup2 user (backup can't be used due it seeing that as a system accountname) with an unlimited bandwith and diskspace package under the admin user
#!/bin/bash
cd /home/backup2 rm -f *.tar.gz
tar -zcvf SERVERNAME_SYSTEM.tar.gz /etc/* /root/* tar -zcvf SERVERNAME.tar.gz /home/* --exclude backup2 tar -zcvf SERVERNAME_MySQL.tar.gz /var/lib/mysql/* tar -zcvf SERVERNAME_DIRADMIN.tar.gz /usr/local/directadmin/* tar -zcvf SERVERNAME_DNS.tar.gz /var/named/* tar -zcvf SERVERNAME_MAIL.tar.gz /var/spool/*
Now you'll have all needed packages to restore Directadmin on a server in case something would go wrong, upload them on an external backup server each night to make it secure..., and put the script in the cron ('crontab -e' as root, and enter something along the line: 0 2 * * * /home/backup2/backup.scp to run it each night at 2am) |