Backup on the fly

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
2,328
Location
UA
Hello,

Is there possibility to make backup without duplicating data to backup_tmp_dir?
---
For example I have 100gb account and 100gb free space, if DA makes duplicate of /home/username/ - there is no enough space to put compressed archive, but I still can compress it via ssh and tar czf..
--
Thanks!
 
Yes, it possible, but I'm talking about situation when I need to make backup and can't extend space.
I always can make backup without /domains directory and compress it manually separately, but maybe there will be option to make same from panel in one archive?
 
DirectAdmin needs a way to create a backup package of everything pertaining to an account EXCEPT for it's home directory.

I have mangled something together to where I am able to do this, but it involves passing an alternative directadmin.conf to dataskq and running the datatask queue.

But with the recent updates making changes to how dataskq is executed - I'm not sure if this is going to work going forward.

TYPICALLY an account's /home directory is the largest aspect of an account. And an account's home directory can very easily be backed up separately (i.e. if you wan to use rsync or if you want to tar it up separately). An account's home directory doesn't really play a role in setting up the account from a backup.

You could also make the argument that an account's SQL databases should also be allowed to be excluded because they're probably the second largest part of an account. And they can be dumped separately as well. But typically the size of the SQL databases and having to write a separate SQL dumping system, just doesn't make it all that useful for me. You could also exclude mail (which is in the home directory and would be excluded if the home directory is excluded).

This is how I do back ups both on DirectAdmin and with that other control panel.

I create a backup tar package that can be passed to the restore function and restore an account.

Then I have the account's home directory rsync'd some where else and I can move that directory back into place after restoring the backup package.

This substantially reduces backup time because instead of backing up the home directory every single time, I'm only processing the deltas.
 
@sparek you can almost exclude /home/username/ by excluding "domains" directory and email. We use similar scheme for shared hosting and managed servers, with directadmin backup system creating just "template of account", separately incremental backups of mysql and homes. But for those who rents unmanaged VPS and don't want to keep more than half disk free, for duplicating before backup, "backup on the fly" would be perfect solution.
 
Yea, that's what we do.

Create a copy of /usr/local/directadmin/conf/directadmin.conf and make sure skip_domains_in_backups=1 and skip_hometargz_in_backups=1 are set in this copied directadmin.conf

Then pass:

action=backup&append_to_path=nothing&database_data_aware=yes&email_data_aware=yes&local_path=${BACKUPDIR}&owner=admin&select0=${THEUSER}&type=admin&value=multiple&when=now&where=local

Obviously change ${BACKUPDIR} and ${THEUSER} respectively.

To /usr/local/directadmin/data/task.queue (actually we use a totally unique task.queue and use a hex editted dataskq binary to reference this custom task queue) and execute the task queue with:

/usr/local/directadmin/dataskq --config=/path/to/copied/directadmin.conf d200

(I don't know why I do d200 - probably for verbosity when I was testing this out and just never changed it)

This will create a .tar file in ${BACKUPDIR} for the respective user with practically all of the information pertaining to the account EXCEPT for it's home directory. This .tar file is pushed via rsync to our backup server and then the account's home directory is also pushed to the backup server via rsync.

This means you only need extra space to handle the .tar files for each account in ${BACKUPDIR} - which for us is a little over 1.5% of the account's home directory usage.
 
Back
Top