Option to specify temp directory for a backup job

BadBlock

Verified User
Joined
Apr 18, 2007
Messages
10
Hi guys,

Previously I was creating backup locally and uploading them via FTP to a backup server, but this method has certain downsides:
- It requires way too much free space on the web server to prepare and create backups (I should pretty much have at least half of the HDD free);
- Using the same HDD for reading and writing when creating the final .tar.gz significantly affects the performance of the whole server until the backup job is completed. This may take hours, and the server is slow for hours.
- Deleting a really huge .tar.gz file after successful FTP upload (e.g. deleting a 200 Gb file) effectively locks down the whole server for about 10 minutes, as the HDD subsystem is busy freeing up the blocks occupied by the file - CPU load soars, web pages time out etc.

So I decided to mount a directory from the backup server on the web server (via SSHFS) and backup right there as if it was a local directory.
This method seems to work way better, noticed just one issue here, and it is as follows:

- For local backups, the backup job seems to be first preparing certain backup files in a <backup_dir>/username subdirectory, copying lots of files there (sql backups, user data, unreadable data etc.) and then gzips-tars the whole thing.
- Gzipping-tarring on a network mount incurs significant network overheads, slows down the backup job, and puts additional load on the network subsystem.

So what I would like to suggest is to add a text input field to the backup job add/edit form to specify the temporary path where backups will be prepared before final gzipping-tarring (in my case this will be a local directory on the web server, outside the network mount).

Thank you.
 
Thanks a lot, I haven't noticed this option.
Not too sure if it answers the question, as the default setting for backup_tempdir, according to the doco, should be tempdir (/home/tmp by default), which is definitely outside of my network mount.
I double checked that the backup_tempdir is not set in my conf, and that the tempdir is /home/tmp
This means that the network mount should not have been used as a temp dir, but this doesn't appear to be the case: as I said, <backup_dir>/username directories are still created on the fly and removed when the backup is completed.
Anyway, I'll now explicitly set backup_tempdir=/home/tmp and check again.
 
That does answer your question?

Thanks for your efforts. Unfortunately it does not answer my question as this setting does not seem to have any effect on "local" backups.

Even though accodring to the docs, backup_tempdir is /home/tmp by default, and I've now explicitly set it to /home/tmp,
when backing up to a local path Directadmin still uses the target backup path for collecting backups, not the backup_tempdir.

I.e. the following files and directories are created in the target backup directory:
Code:
<backupdir>/<username>/backup/<domain1>/... (lots of stuff)
<backupdir>/<username>/backup/<domain2>/... (lots of stuff)
<backupdir>/<username>/backup/<domain3>/... (lots of stuff)
<backupdir>/<username>/database1.conf
<backupdir>/<username>/database1.dump.log
<backupdir>/<username>/database1.sql
<backupdir>/<username>/database2.conf
<backupdir>/<username>/database2.dump.log
<backupdir>/<username>/database3.sql
In the meantime, /home/tmp is empty.
 
Back
Top