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

martin

Re: Task Scheduler - GET and MOVE

It should be mv file-int-*.mp /old/

Though note that your script is not transactionally safe. If a new file appears after get starts, but before mv, it won't be downloaded, but will be moved.
For a translatioanlly safe solution see https://stackoverflow.com/q/48311614/850848
whgragso

Task Scheduler - GET and MOVE

I have a script setup to get files from my SFTP and place them on a local folder. Instead of deleting the file after I get the file, I would like to move it to a folder on my SFTP. The get function is working but the mv is not. Any ideas?

open sftp://********************/ -hostkey="ssh-rsa 2048 *******************=" -privatekey="*************************"

cd /upload
lcd C:\TEST

get file-int-*.mp
mv file-int-*.mp /old

exit