Upload files to ftp...
 
Notifications
Clear all

Upload files to ftp / execute system command

3 Posts
2 Users
0 Likes
1,413 Views
Posts: 20
Topic starter
(@aftab)
Eminent Member
Joined: 8 years ago

Hi,

I'm trying to set a scheduled task to upload files to an ftp server, however that fails as SolidCP is using ftp.exe and that doesn't support TLS. So I've grabbed a portable copy of winscp, placed it the hostingspaces folder, with the script file in the hostingspacesadmin folder. I've set the scheduled task to the following:

Type: Execute System Command
Server Name: left the field empty
Executable Path: C:HostingSpaceswinscp.com
Executable Parameters: /script=C:HostingSpacesadminupload.txt

The tasks executes but nothing happens, I can't see winscp.com or winscp.exe in task manager, so its not executing the program. The audit log doesn't show anything and when the task is run it stays in 'running' status for a while, but nothing seems to get executed.

Any ideas, and is there any chance the SolidCP will switch to an ftp client that can work with TLS?

2 Replies
Posts: 1456
Admin
(@trobinson)
Noble Member
Joined: 8 years ago

Hello,

 

I am not familiar with using winscp on the command line but we can check this. Would you be able to post a the script it is trying to run (With all personal details removed)?

 

At the moment we use ftp.exe as this is built into windows but we can look into if its possible for the admin to list other options like winscp.

 

Kind Regards,

 

Trevor Robinson

Reply
Posts: 20
Topic starter
(@aftab)
Eminent Member
Joined: 8 years ago

Hi Trevor,

Sure the script is as follows:

# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Force binary mode transfer
option transfer binary
# Establish the connection
open ftp://username:password@ftp .domain.com
# Change the Local Directory
cd /HostingSpacesBackups
# Upload admin directory
put C:-HostingSpaces-admin

This is executed with the following command and works correcting from the command line:

C:-HostingSpaceswinscp.com /script=C:-HostingSpaces-admin-upload.txt

The winscp.exe executable is on C:-HostingSpaces as that is what winscp.com makes use of.

Other than a different executable is very similar to the commands that are used by ftp.exe, which I saw when the scheduled task created a temporary script file in C:-HostingSpaces-admin.

Edit: backslashes are being removed so I'm placing a hyphen in their place.

Pastebin of script and command:  http://pastebin.com/raw/JjsK2p5q

Reply
Share: