Topic "synchronize and delete at one step"

Author Message
theUserWhoLikesScripting
[View user's profile]

Joined: 2006-09-19
Posts: 4
Location: Allemagne
Hi

I have written this script :
Code:

option batch on
option confirm off
option exclude "*_110-*; *_210-*"
synchronize remote -delete d:\docs\test /srv/blabla

close
exit

Execution (would) delete(s) all files in balbla, that don't exist in test AND
transfer all files to blabla, that don't match my filter

My question : How can I modify the script to make it delete all those files with "*_110-*; *_210-*" ?
Or do I have to get them away with RM ?

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
theUserWhoLikesScripting wrote:
Or do I have to get them away with RM ?

Correct.
_________________
Martin Prikryl
theUserWhoLikesScripting
[View user's profile]

Joined: 2006-09-19
Posts: 4
Location: Allemagne
Thanks

I was expecting that
JuValencia

Guest


prikryl wrote:
theUserWhoLikesScripting wrote:
Or do I have to get them away with RM ?

Correct.


Hi, I have something like that, how can I automate the delete file after synchronize. Would you help me with the command.

so far This is my automated command-line syntax

C:\> winscp.com /command "option confirm on" "option include "ven*.pgp"" "open sftp://user:pass@RemoteServer" "synchronize local c:\Test\ /remoteFolder -delete" "exit"

Basically My local folder test should get synchronize from the Remote folder, and after the synchronization is done, I should the delete the files from the Remote server.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
JuValencia wrote:
Basically My local folder test should get synchronize from the Remote folder, and after the synchronization is done, I should the delete the files from the Remote server.

That you should use "get -delete" instead of "synchronize", shouldn't you?
_________________
Martin Prikryl
mark.k

Guest


Question based on the messages above:

I don't want to use the command RM after get or synchronize. In that case, I will take the risk files being deleted that are added to the remote folder during the synchronize or get process. Is there an option to delete the files within the synchronize process or use local filenames-list in the RM command-'array'?

To make things clear:
I need a program to:
*Check if files are added to the remote folder
*Download added files
*Delete the files in the remote folder that are available locally
*No files may get lost during the process

Thanks,
Mark
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I have added this topic to FAQ:
https://winscp.net/eng/docs/faq_delete_synchronized_files
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License