How to debug system backup with remote transfer problem?

cDGo

Verified User
Joined
Sep 21, 2012
Messages
86
Hi, We've got several servers all with latest version of DA.
All servers have been setup equally to use system backup and transfer via SCP to a central backup server.
All servers except one work as expected.

The one which doesn't transfer, does make the backup according CMD_SYSTEM_BACKUP/status.log.txt and visual inspection.
But the data is not transferred to the backup server.
I can ssh to the backup server and transfer files to the backup server.

I just can't find out why the files aren't transferred.

So any advice or suggestions are welcome.

Domé
 
Hello Domé,

Directadmin utilizes /usr/local/directadmin/scripts/ftp_upload.php to upload backups to a remote server.
So you can update the script with your own instructions to write details into a separate log file for further debugging.
Or try and setup a task to create backup "now" and trigger in root console:

Code:
/usr/local/directadmin/dataskq d8000 | tee output.log
 
Hi Alex,

Thanx for your respond.
But I think it's better to have you do such things, I'll get me a ticket and contact you probably tomorrow.

Domé
 
It was discovered that when we use incremental file-by-file transfer of System Backup to a remote server via SCP it fails.


It happens due to how scp understands -r flag, and it will certainly drop errors similar to the following:


Code:
     Transferring httpd.conf.tar.gz to aa.bb.cc.dd: scp: backups/05-06-16/custom/etc/httpd/conf/: No such file or directory
     Transferring httpd.conf.md5 to aa.bb.cc.dd: scp: backups/05-06-16/custom/etc/httpd/conf/: No such file or directory


-r flag with scp recreates directory structure only if we transfer recursively a folder to a remote server, and it's completely ignored if transfer file by file.


Here you can find a possible patch: http://files.plugins-da.net/dl/patch/internals.sysbk.patch.txt


The main idea of which is as the following: before doing a transfer with scp, we login with ssh and check existence of a directory and if it does not exist, we create it:


Code:
ssh $SCP_USER@$SCP_HOST -i $PRVID_FILE "test -d $SCP_RPATH/$DPREFIX || mkdir -p $SCP_RPATH/$DPREFIX"


and


Code:
ssh $SCP_USER@$SCP_HOST -i $PRVID_FILE  "test -d $SCP_RPATH || mkdir -p $SCP_RPATH"
 
Back
Top