ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
I'm writing a simple script to establish a secure FTP connection and send out a reboot command. First off is there any change I need to make from one of the sample scripts to connect via sftp instead of ftp and secondly is there any sort of proper syntax for issuing commands? Like if I am doing the same thing in Putty I can just type in reboot and hit enter and the remote target will reboot.

Thanks,

Ben
Hello Ben,

The old FTP protocol has a command called "SITE EXEC" that allows the client (ScriptFTP in this case) to send a non-FTP command to the server, but most servers do not have it enabled by default for security reasons. From the ScriptFTP side, this was invoked using RAWCOMMAND("SITE EXEC the_command")
I'm writing a simple script to establish a secure FTP connection and send out a reboot command.
Secure FTP can be FTPS and SFTP which are different protocols. FTPS is just FTP over a SSL layer and using the SITE command is possible but it will probably not work without modifying the FTP server configuration.

If you are using SFTP there is no such command and you will have to find a workaround such uploading a flag file (called 'you_need_to_reboot_now.txt', for example) and write a small script on the FTP side that periodically check for that file and reboot.

There are other ways but I am only writing about the ones that can be done with ScriptFTP.
So it's definitely SFTP. And our remote targets are running a linux environment. So I can open up Putty (or I'd any similar program like cygwin etc) and target the remote IP address. Enter the username and password and then I'm in. I can then just issue a reboot by typing in "reboot" and the remote server does just that. So I'm guessing there's already a back-end setup for reading that command. So I just need a script that starts a SFTP connection and issues the reboot command. What would that look like?
I am afraid this is not possible with ScriptFTP, sorry