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://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://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 -delete [local directory] [remote directory]
synchronize local -delete [remote directory] [local directory]
it seams i click somewhere by mistake and i got server file deleted how i get them back
synchronize local -filemask="*.*"
synchronize remote -delete -filemask="*.*"
winscp.com /console /script="synch.scr"
robocopy "tempdir" "finaldir" /MOVE /E
winscp.com /console /script="cleanup.scr"
synchronize
command, like:
synchronize remote -nopreservetime -nopermissions -delte "C:\Users\Local\Directory" "/remote/directory"
option confirm off
open ftpsession
synchronize remote -nopreservetime
synchronize remote -nopermissions
synchronize remote "C:\Users\Local\Directory" "/remote/directory"
synchronize remote -delete
exit
winscp.exe /console /command
"open FTPLogin"
"synchronize local -delete -filemask="*.zip" "
"\\target\location\"
" /sourceLocation"
"close"
"exit"
Any advise on whysynchronize local -delete
command is not working?
synchronize local -delete
command is not deleting files in remote folder :(
synchronize local -delete
command is not working?
-delete
switch tells it to delete whatever files are not present in the opposite directory.
rmdir
command.
option batch on
option confirm off
open username:password@sftp.site.com
cd /remotedir
option transfer binary
synchronize local -delete
synchronize local c:\localdir /remotedir
close
exit