Admin Backups just do not work

TheCableGuy96

Verified User
Joined
Apr 29, 2010
Messages
43
Hi,

I'm pretty stumped with this as I've tried everything within my knowledge.

I used to run a CentOS 7.x server with DA which was running fine. After many years it's degraded and needed a format so I've replaced it with AlmaLinux 9.1 which I believe is the new "in-thing".

Everything is up and running and working apart from the Admin backups which I use to backup to a Synology NAS using FTP(s). For some reason I am getting this error instantly when trying to setup the backups (I have tried with FTP and FTPs selected):

/usr/bin/curl returned error code 7
curl: (7) Failed to connect to 192.168.1.249 port 21: Connection refused
FTP information invalid.

I've checked and can connect locally with my PC using FileZilla.

I can also connect from the server itself using the CLi:
ftp> o 192.168.1.249
Connected to 192.168.1.249 (192.168.1.249).
220 SHS1 FTP server ready.
Name (192.168.1.249:root):

Firewall can't be the issue if it's working from CLi but not the DA system. But I've selected FTP and FTPs and the ports are open so I'm stumped.

I've read somewhere it could be the Curl version but I've checked and it's the latest version yum is offering me so I can't upgrade it if there is a later release:
[root@fs1 ~]# curl --version
curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.76.1 OpenSSL/3.0.1 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh/0.9.6/openssl/zlib nghttp2/1.43.0
Release-Date: 2021-04-14
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

Would anyone be able to offer any suggestions?

Thanks in advance!
 
Okay i'm getting somewhere. I've got it connecting but it's now coming back saying my backups are ready in the ticket system but it's full of errors inside the ticket like this:

User admin has been backed up. <21:11:57>
ftp_upload.php exit code: 0
ftp_upload.php output: cannot find file: #
<21:11:57>

I'm wondering if it's something to do with the /usr/local/directadmin/scripts/ftp_upload.php file as i've been messing since trying to follow one of the DA guides. Could anyone share the contents of the original as I stupidly didn't back it up first?

Thanks.
 
Last edited:
Ok try the solution from @zEitEr saved me many time with this kind of stupid errors
 
Ok try the solution from @zEitEr saved me many time with this kind of stupid errors

Thanks I already created a ticket last night with DA and they requested access so i'm waiting for them to login and take a look. As is stands it is connecting to the FTP server (the logs on the NAS confirm it), and it will backup locally, but i'm just getting this error when it can't find the file. I'll wait to see what they say now and if they give me any feedback i'll update for others in the future.
 
Update...

I'm told this was the ftp_upload.php script. Although I have downloaded what I thought was the latest from:
https://files.directadmin.com/services/custombuild/all/ftp_upload-1.2.php.txt

I'm told this is not the latest and all scripts are bundled with DA itself. I also tried to get the script from someone else in IRC who provided me with a copy of theirs which also didn't work so i'm not sure why.

DA said they "renamed usr/local/directadmin/scripts/custom/ftp_upload.php to ftp_upload.php_bak" and now it works so I can only assume that it re-creates the script.

All working now, thanks for everyone's help and I hope this helps someone else :)
 
Everything is up and running and working apart from the Admin backups which I use to backup to a Synology NAS using FTP(s).
I'm maybe going a bit offtopic here but I switched to the Synology Active Backup for Business (free) package. It has an easy GUI and uses rsync to download the backups to your NAS. There is an activity log and you get notified if there are any errors. No need to use any scripts or open ports.

Scherm­afbeelding 2023-02-04 om 21.59.54.png

Maybe worth a try.
 
No need to use any scripts or open ports.
Except for port 22 I presume, which is normally used for rsync? Or what is that package using?
If it's software which uses fetch to rsync, so make outgoing connections, then at least the port on the DA server needs to be open, so you need an open port somewhere, right?

But rsync works nicely. I used it to sync between two of my qnap servers at home. Might indeed be worth a try.
 
I wasn’t entirely clear with that sentence, indeed that port (or whatever port you’re using) needs to be open on your server. I meant that on your home NAS / server you don’t need to open any ports or ranges.
 
Back
Top