cronjob stopped working

grandm1961

Verified User
Joined
Nov 30, 2020
Messages
28
Hello, i have a problem with my backup cronjob. I have a NAS as my backup and at first it worked through FTP.
This however stopped working now and FTP is complaining, that credentials are wrong and it cannot establish a working FTP connection.
I have tried this: Help link from the directadmin help and i have tried to make a FTP connection with my NAS.
I was successful with altering this: /usr/bin/ncftpput -f ftp.cfg -V -t 25 -P 21 -m "/ftp/path" "/local/file.tar.gz" into this: /usr/bin/ncftpput -f ftp.cfg -V -t 25 -e 21 -m "/ftp/path" "/local/file.tar.gz" and it worked flawlessly. Than i went on to This URL and tried to copy ftp_upload.php to /usr/local/directadmin/scripts/custom/ftp_upload.php and alter that file with this:

/bin/sh
/usr/bin/ncftpput -t 25 -m -u "$ftp_username" -p "$ftp_password" "$ftp_ip" "$ftp_path" "$ftp_local_file" 2>&1
RET=$?
exit $RET


into this:
/bin/sh
/usr/bin/ncftpput -t 25 -e 21 -m -u "$ftp_username" -p "$ftp_password" "$ftp_ip" "$ftp_path" "$ftp_local_file" 2>&1
RET=$?
exit $RET


But it still gives me the same error:
connect to 192.168.2.235:33595 failed: Connection refused.
connect to 192.168.2.235:36810 failed: Connection refused.
connect to 192.168.2.235:61868 failed: Connection refused.
Falling back to PORT instead of PASV mode.
Transfer failed. Check the path value. (error=3)

FTP information invalid.

Even if i tried to alter the /usr/local/directadmin/scripts/ftp_upload.php
the outcome is the same, and when i am doing it through the terminal with: /usr/bin/ncftpput -f ftp.cfg -V -t 25 -e 21 -m "/ftp/path" "/local/file.tar.gz" it works

I am lost now of how to make it work, and why it did stop working before.
 
on DA Box
Do you have firewall, Like csf firewall ?
try stop firewall, and test again.

if it's working,
it's seem your "outgoing port" doesn't open,

try open port from 32000:65500

I don't know how you config your ftp server with passive mode
try open between your port range that on passive mode.
 
I have checked the configserver and added the IP address for my NAS and the whole range of my private ip's and even added inside configserver to open those ports when used internally and the seems to be doing the trick. Thanks for the quick response was helpful
 
Back
Top