[release] sFTP backups for DirectAdmin (version: 0.1.poralix)

Livonias

Verified User
Joined
Oct 11, 2019
Messages
6
Getting an error

Hi Alex,

Thanks so much for this script. I've tried to make backups to my STACK environment (SFTP over ssh port 22) for ages.

I've installed the script and setup the cron, however it gives this error:

Code:
User justin has been backed up. <9:25:03>
ftp_upload.php exit code: 1
ftp_upload.php output: [upload] sftp return code: 1
<9:25:03>

Although a backup error has occurred, the upload of valid backups would have still been attempted to ftps://stack.*.nl/October/11/ <9:25:03>
When I start a sftp connection at Cyberduck for example it works perfectly. I see in the url it says ftps instead of sftp. I'm probably doing something wrong, but not sure what. Do you have any idea?

My cron settings:
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
Try and change secure FTPs to plain FTP, and see whether or not it helps. The custom script will detect sFTP by port number specified in the backup task.
 

Livonias

Verified User
Joined
Oct 11, 2019
Messages
6
Thanks, just tried a few different settings and normal FTP with port 22 works.

But it does only work with default path's. When I use custom path: %B/%d or %B/%d/ it gives an error. When I choose one from the list it works perfectly.

So no big issue right here, but if you have a fix let me know please :) thanks again for this great script!
 

experttechit

Verified User
Joined
Jun 30, 2019
Messages
36
Hi @zEitEr

On a new server we are getting the error:

  • sftp return code: 3
    Failed to change pseudo terminal's permission: Operation not permitted
    FTP information invalid.

    Can you help at all please? we have the same settings working on other servers so I know they are correct, but for some reason getting this error?

    Thanks in advance.
 

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
31
Location
The Netherlands
Thanks, just tried a few different settings and normal FTP with port 22 works.

But it does only work with default path's. When I use custom path: %B/%d or %B/%d/ it gives an error. When I choose one from the list it works perfectly.

So no big issue right here, but if you have a fix let me know please :) thanks again for this great script!
Hi @Livonias just started using the script as wel had similar issue.. Just to state the obvious but check for double // in url
if you for example have a remote path like this: /here/are/mybackups/ with a date as custom variable.
It will generate the following dir: /here/are/mybackups//01-dec-2019/
This is cause the custom variable starts with /
In thiscase remove / in remote path field.

@zEitEr Lovely script works like a charm
 

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
31
Location
The Netherlands
Oops My assumption was wrong it keeps failing.
Error:
2019:12:01-06:00:02: uploadFtpFiles('admin.tar.gz', , /home/tmp/admin.15045, diradmin) failed (is_missing_user_ok=0)

I have now manualy created the dir to see if that works.

Nope something changed indeed since it worked first few days.
futher troubleshooting:
Code:
2019:12:03-01:39:03: uploadFtpFiles('user.tar.gz', , /home/tmp/admin.10888, diradmin) failed (is_missing_user_ok=0)
2019:12:03-01:41:28: uploadFtpFiles('user2.tar.gz', , /home/tmp/admin.10888, diradmin) failed (is_missing_user_ok=0)
2019:12:03-01:41:38: uploadFtpFiles('user3.tar.gz', , /home/tmp/admin.10888, diradmin) failed (is_missing_user_ok=0)
2019:12:03-01:41:38: uploadFtpFiles('user4.tar.gz', , /home/tmp/admin.10888, diradmin) failed (is_missing_user_ok=0)
2019:12:03-01:41:42: uploadFtpFiles('user5.tar.gz', , /home/tmp/admin.10888, diradmin) failed (is_missing_user_ok=0)
2019:12:03-01:41:42: uploadFtpFiles('user6.tar.gz', , /home/tmp/admin.10888, diradmin) failed (is_missing_user_ok=0)
This might be relevant.:
 
Last edited:

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
31
Location
The Netherlands
Update: Ok found the cause it was:

I have a custom path: "%d-%b-%Y/00-00" for 4 scheduled task (06-00 12-00 18-00) just so it looks nice and tidy. I started out with: "%d-%b-%Y/%H-%M" Reverted back to this now backups are running again checked with the provider they told me DA tries to create the path but fails cause the underlying dir is not present.

Not sure if this is a bug in DA or issue with @zEitEr script. Perhaps @smtalk could enlighten us ?
 
Top