Re: Delete a remote file after successful sync
Thanks, it worked very well.
I want to delete a specific file from remote destination: lock.pid.
rm command:
option batch abort
option confirm off
option echo off
option transfer binary
open sftp://user@host -privatekey="D:\folder\key.ppk" -hostkey="ssh-xxxxxxxxxxxxxxxxxxxxx"
synchronize remote source -delete="lock.pid"
close
put -delete SOURCE DESTINATION
In the link that you shared, they have given example to synchronize remote to local and delete contents of remote. But i want the other way round - synchronize local to remote and delete local. Can you also plz test on your end and help me with the correct command?
put -delete as the article suggests.
I want to delete the files from local directory once i have synchronized with remote directory.
See https://beta.winscp.net/eng/docs/faq_delete_synchronized_files
I want to delete the files from local directory once i have synchronized with remote directory.
#Resources Can be Found here - https://beta.winscp.net/eng/docs/scripting
option batch abort
option confirm off
open scp://XXX:YYY@localhost -hostkey="ZZZ"
synchronize remote -delete [local directory] [remote directory]
exit
synchronize local