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 currently use ScriptFTP on an AWS instance, to connect to firewalls and routers, using open ports and DDNS.

I'm soon going to be looking at a couple of installs where an external IP won't be available. (Mobile Sim connections, and satellite broadband etc...)

So, my solution is to get my remote hosts to upload logfiles to the server, rather than have the server download them. So I'm creating an .sh script to run on the remote hosts. I want to include this output in my logfile created by ScriptFTP.

What is the best way about this?

Stop Output Logging, Run a custom script to append the downloaded log into the ScriptFTP log, then restart ScriptFTP logging with Append.

Or is there an easier way to import a custom file into the log?
Hi,

Yes, I think you have to do that the way you suggested: stop the logging, append the other file and resume logging. For appending file contents you have to use the EXEC command:

FTP Script
  1. # start logging
  2. LOGTO("C:\Users\Carlos\Desktop\mytestlog.txt")
  3.  
  4. # Open connection, transfer files etc
  5.  
  6. # stop logging
  7.  
  8. # append the downloaded log file. Got it from:
  9. # https://stackoverflow.com/questions/19750653/how-to-append-text-files-using-batch-files
  10. EXEC('type "C:\Users\Carlos\Desktop\the_downloaded_log_file.txt" >> "C:\Users\Carlos\Desktop\mytestlog.txt"')
  11.  
  12. # resume logging
  13. LOGTO("C:\Users\Carlos\Desktop\mytestlog.txt",APPEND)
  14.  
  15. # continue doing other stuff