An error occurred during the backup (id=1) only on FTP transfer

blacksrv

Verified User
Joined
Mar 11, 2014
Messages
7
Hello everyone, I'm having problems with the backup function, I'm using "Admin Backup/Transfer", and if I set the backup to Ftp, I get this error: "An error occurred during the backup (id=1)", if I do it locally it works fine.

I notice that the files and folders are actually created in /home/tmp but just after 1 sec dissapears. Any ideas?

Thanks
 
Command::doCommand(/CMD_ADMIN_BACKUP)
executeAsUser('/bin/sh', 512, nobody, 1, '
FTPLS=/usr/bin/ncftpls
TMPDIR=/home/tmp
PORT=${ftp_port}

if [ "$PORT" = "" ]; then
PORT=21
fi

if [ ! -e $FTPLS ]; then
echo "";
echo "*** Unable to get list ***";
echo "Please install $FTPLS by running:";
echo "";
echo "cd /usr/local/directadmin/scripts";
echo "./ncftp.sh";
echo "";
exit 10;
fi

RANDNUM=`/usr/local/bin/php -r 'echo rand(0,10000);'`
#we need some level of uniqueness, this is an unlikely fallback.
if [ "$RANDNUM" = "" ]; then
RANDNUM=$ftp_ip;
fi

#man ncftpls lists:
#If you want to use absolute pathnames, you need to include a literal slash, using the "%2F" code for a "/" character.
#use expr to replace /path to /%2Fpath, if needed.
CHAR1=`echo ${ftp_path} | awk '{print substr($1,1,1)}'`
if [ "$CHAR1" = "/" ]; then
new_path="/%2F`echo ${ftp_path} | awk '{print substr($1,1)}'`"
ftp_path=${new_path}
else
ftp_path="/${ftp_path}"
fi

CFG=$TMPDIR/$RANDNUM.cfg
rm -f $CFG
touch $CFG
chmod 600 $CFG
echo "host $ftp_ip" >> $CFG
echo "user $ftp_username" >> $CFG
echo "pass $ftp_password" >> $CFG

DUMP=$TMPDIR/$RANDNUM.dump
rm -f $DUMP
touch $DUMP
chmod 600 $DUMP

$FTPLS -l -f $CFG -P ${PORT} -r 1 -t 10 "ftp://${ftp_ip}${ftp_path}" 2>&1 > $DUMP
RET=$?

if [ "$RET" -ne 0 ]; then
cat $DUMP

if [ "$RET" -eq 3 ]; then
echo "Transfer failed. Check the path value. (error=$RET)";
else
echo "${FTPLS} returned error code $RET";
fi

else
cat $DUMP | grep -v -e '^d' | awk '{ print $9; }'
fi

rm -f $CFG
rm -f $DUMP

exit $RET
', int *child_pid, *snd, group=(null)) uid=99 gid=99
Command::doCommand(/CMD_ADMIN_BACKUP) : finished
Command::run: finished /CMD_ADMIN_BACKUP

this is what I get when I run the backup, I'm having the same problem in another server but only with a couple accounts :confused:
 
I start testing with individual accounts, one by one, for some reason in some accounts works, and in other don't. I tested with different resellers, different users and it's the same.
 
Back
Top