Sync Files, Copy & Delete

Advertisement

DWoods
Joined:
Posts:
1
Location:
United Kingdom

Sync Files, Copy & Delete

I have set-up a script that will synchronize remote files to a local folder, and from a local folder to remote. However, what i am wanting to do is have a script that will detect any changes in the local folder such as if a file/ folder is deleted or renamed that it will synchronize with the remote folder.

I have seen script that once the file is transferred over to the remote location it will delete the file but that is not what i am after. I wish to be able to delete the file manually through windows explorer and the script update and process the rest.

the script i am using at the moment is:

.txt file
#Resources Can be Found here - https://winscp.net/eng/docs/scripting
option batch abort
option confirm off
open ftp://usrname:pwd@ftp.address/
synchronize remote [local folder] /[remote folder]
exit
.bat file
@echo off
:loop
winscp.com /script=SyncToRemote.txt
timeout /t 120
goto loop

Reply with quote

Advertisement

Guest

how to synchronize files from local to remote and delete local files in winscp

I want to delete the files from local directory once i have synchronized with remote directory.

Here is my script,
#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
With the above script, files are getting deleted in remote directory.

If i use the below script, then files from remote is getting synchronized to my local.
synchronize local -delete [local directory] [remote directory]
If i switch the directory then i get an error,
synchronize local -delete [remote directory] [local directory]

Reply with quote

Advertisement

You can post new topics in this forum