sys Backup Best Practice

Mark_S

Verified User
Joined
Sep 14, 2006
Messages
67
Hi,
i'm using Direct Admin 1.29.2

Ive been browsing around these forums looking for the best way to Back up in post recovery from a crash or failure. And alot of the guides and help are out of date (The ones i could find).

I'm new to how things work inside Direct Admin and put alot of faith in the point and click to do things, but i'm now becoming increasingly worried about "What if" ? And what Solutions are available.

SYSBACKUP - (Admin)
If i could ask a few Questions about system backup as admin, what i should be doing.

The Config screen has the following options I need advice with.

1. Add user home directories to directory list below?
Would enabling that option effectively backing up everthing? Users and there Domains and Files and Settings?
2. Backup Directories and Files listed below?

These are the files that are in the list but i do not have selected.
Should these be included everytime i run a sysback up?


Directories
/etc/mail
/etc/virtual
/home/admin
/usr/lib/apache
/usr/local
/usr/local/directadmin/data
/usr/local/frontpage
/usr/share/ssl
/var/log
/var/mail
/var/named
/var/spool/cron
/var/spool/mail
/var/spool/virtual
/var/www

Files
/etc/exim.cert
/etc/exim.conf
/etc/exim.key
/etc/exim.pl
/etc/group
/etc/gshadow
/etc/hosts
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/ips.conf
/etc/named.conf
/etc/passwd
/etc/proftpd.conf
/etc/proftpd.passwd
/etc/proftpd.vhosts.conf
/etc/resolv.conf
/etc/shadow
/etc/ssh/sshd_config
/etc/system_filter.exim
/usr/local/directadmin/conf/mysql.conf

I just want to have the right back up in case of a crash or hard drive failure and have some peice of mind that i have what i need to attempt a restore.

You experience and advice would be very much appreciated.

Thanks
 
1. Add user home directories to directory list below?
Would enabling that option effectively backing up everthing? Users and there Domains and Files and Settings?
It would back up everything in the /home/USERNAME directory structure for your users. To see what's in the /home directory structure look at the files manager for one or more of your users. Since users can upload anything they want, for safekeeping, into their /home/USERNAME directory, this is important, though it could result in a large backup, for example, if your user is (some do it) backing up his/her home system there.

For systems using Dovecot (Maildir) email delivery, it also backs up the mailstore for each user's mail accounts.
2. Backup Directories and Files listed below?

These are the files that are in the list but i do not have selected.
Should these be included everytime i run a sysback up?
By selected do you mean with a checkmark? All the directories in that list get backed up. Checking them is simply so you can delete them from the list; to see what I mean scroll through them until you see the delete button. Clickon on the delete button will delete all the ones checked.

First note that for each directory listed here all files will be backed up, but subdirectories will NOT be backed up unless they're also listed.

That said, some of these can be deleted; however consider the notes I've made below for specific directories.
Directories
/etc/mail
/etc/virtual
/home/admin
/usr/lib/apache
/usr/local
/usr/local/directadmin/data
/usr/local/frontpage
/usr/share/ssl
/var/log
/var/mail
/var/named
/var/spool/cron
/var/spool/mail
/var/spool/virtual
/var/www
We backup /var/log, but you may not want to; you don't really need it to do a restore.

On every DA install I've ever seen, /var/mail is a symbolic link to /var/spool/mail; so you probably don't have to backup /var/mail as long as you do backup /var/spool/mail. However since the backup only backs up the actual symbolic link you won't take up much space if you back it up.
Files
/etc/exim.cert
/etc/exim.conf
/etc/exim.key
/etc/exim.pl
/etc/group
/etc/gshadow
/etc/hosts
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/ips.conf
/etc/named.conf
/etc/passwd
/etc/proftpd.conf
/etc/proftpd.passwd
/etc/proftpd.vhosts.conf
/etc/resolv.conf
/etc/shadow
/etc/ssh/sshd_config
/etc/system_filter.exim
/usr/local/directadmin/conf/mysql.conf
These should all be backed up.
I just want to have the right back up in case of a crash or hard drive failure and have some peice of mind that i have what i need to attempt a restore.
This is what we backup and it should give you what you need; however it's been a long time since we attempted a restore (we're going to do a test in a few weeks) so don't take our word for it. We recommend you do a test restore long in advance of actual need. We realize this may cost time and money but we still recommend it.

Jeff
 
Appreciated thank you.

I will have to go down that route of a test "Restore" which would be next question but not today as i want to concentrate with your help on the "Admin" system back up.

Yeh i checked the log file after a sys back up and it listed all the files in that list :)
And now ive read your post above, i can see the delete option at the bottom :)

----------
Okay so i now have a directory with my sys back done.
I'm viewing the contents via putty so it looks like i have
a folder 13-05-07
The Contents are apache; bind; custom; mysql

Which seem about right to me.

1. Now how can i get the files from there to down load locally?
Can i move them to a new directory?

2. In the sys backup config, there is an option to change the back up path. Its currently set too $MOUNT_POINT/backup but when i change the path to say
$MOUNT_POINT/userx/backup
it still wants to back up in the original loacation?

I would appreciate any help in getting system back upfiles out of the default diectory and then i can down load them, with FTP, as i dont have a remote file server at the moment.

Thanks for any help or advice :)
 
I don't know why $MOUNT_POINT isn't working for you; you can see what it equates to by looking at the /usr/local/sysbk/conf.sysbk file. But you should probably NOT change it.

Instead of using $MOUNT_POINT in your path use the full hard-coded path.

You can use DA to set an ftp path to your local system if your local system is on at the time of the backup, if it runs an ftp daemon (some commercial ftp programs for windows include an FTP daemon), and if either your local system is on a static IP (and you open any local firewall as required).

Otherwise you'll have to use either a local ftp or scp client to move the backup to your local system.

Jeff
 
Ive just tried the full path :( No joy,
the e-mail message pretty much equates to already exists and again its pointing to the original path.

Not to worry,
ive got a page open on bash commands,
i should be able to move those files to a new location yeh?

using
cp [options]... Source... Directory

I'm unable at the moment to create an static IP at the moment its static but half the area have it i need to get a router installed to help with that side of things.

http://www.ss64.com/bash/

should i tar them first?
I'm assuming its a folder as i can
cd 13-05-07
and then see apache; bind; custom; mysql

Are there any parameters i should use with tar ?

Thank you again.
 
tar -czf /home/user/backups/sys/bkup.tar.gz 05-13-07

where 05-13-07 is the name of the system bkup.

So at least i have a system back up saved on my local machine, not the quickest solution..

Inside this file i have

mysql; custom; bind; apache

and if i follow custom/usr/
i have a local.tar.gz file which is quite big.

Does the above seem the correct collection for a system back up?

Now i have to look at the reseller backups
I will start a new topic for that one.

Thanks for the help.
 
Quick Question

Is it correct that when SYSBACKUP - (Admin)
performs its back up that the files are not Tarballed?

I'm maybe getting a little confused? As i'm using putty and not 100% with the colours its showing,
in this case i see blue which i'm lead to believe is a folder,
and red is a tar?
 
Colors depend on your shell settings (generally they're OS Distribution dependent.

You can try to edit a file to see if it's compressed or not, but sysbk will add .tar.gz to all it's tarball files.

Jeff
 
Back
Top