Backups take too long to create. Use rsync for /home


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin » Backup & Restore Process

Backups take too long to create. Use rsync for /homeLast Modified: Aug 26, 2014, 3:39 pm
As webservers get more and more disk space, this means they can hold more data, and as such, the backup process will take long than before.

For servers where the bulk of the data is stored in email data or public_html data (uploaded by the User), using rsync on /home is a great alternative to including that data into your DA backups.

NOTE: You must restore the DA accounts before doing the rsync, or the DA restore may have errors.  You can repeat a DA backup/restore a 2nd time if you want a more updated version, but DA must create accounts first, before doing the rsync.
Debian/FreeBSD: If you rsync /home/mysql, this means you have to ensure /usr/local/directadmin/conf/mysql.conf is from the old box.

1) You would still need to create DirectAdmin backups at:

Admin Level -> Admin Backup/Transfer

however, in Step 4: What you could select the data you want to include, and de-select the "Domains Directory" and "E-Mail Data".  These 2 items are stored in /home, thus rsync would handle them instead.


2) Such a root run script could be used to push all /home data, over to another remote.hostname.com box with the remote path /home/backupuser/home:

#!/bin/bash
BACKUP_HOST="remote.hostname.com"
BACKUP_USER=`hostname -s`
BACKUP_SOURCE="/home"
BACKUP_DESTINATION="/home/$BACKUP_USER/users"
ionice -c3 nice -n 19 rsync -q -a --delete -e ssh $BACKUP_SOURCE $BACKUP_USER@$BACKUP_HOST:$BACKUP_DESTINATION >/var/log/backup.log 2>&1



*NOTE* that this also means doing a restore would require an extra step:
- restore the DirectAdmin Backup
- rsync the data back to the restore box, although, adjust the /home/user/domains path to /home/user, for a given User.
- SquirrelMail and Webmail (Uebimiau, if you use it) are also part of the "E-Mail Data" checkbox. Include /var/www/html/squirrelmail/data and /var/www/html/webmail/tmp, to include webmail settings/data.
- Roundcube is not included in either case: http://help.directadmin.com/item.php?id=347
 
Related Helpfiles
Pulling data from a remote directory with rsync
Backing up and transferring very large User accounts
Automating ssh logins with an RSA key

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST