Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

litestream

Error handling

I use the following simple script to connect to a remote site, copy any files there to a local site and then delete the remote files.

open sftp://user:password@ip address
cd /sage
get *.* c:\FTP\incoming\
rm *.*
exit

Is there any error checking I can introduce to prevent the remote files being deleted if the transfer is unsuccessful, or will the rm command not execute and time out if the previous get line does not complete?

Any assistance would be greatly appreciated.