Topic "Delete files on automatic syncronization?"

Author Message
nbr_uk
[View user's profile]

Joined: 2010-09-21
Posts: 1
Hi all, I've automated syncronization using information I found in his thread https://winscp.net/forum/viewtopic.php?t=4181 (thanks Prikryl) and it works a treat - I just need to adjust my script to delete files from the local directory when they no longer exist in the remote directory. It currently reads as follows:

open stored_session
synchronize local [local docs] [docs on server]

Is there a switch I can add to facilitate this? Hope someone can help.

Thanks, nbr_uk
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please read documentation:
https://winscp.net/eng/docs/scriptcommand_synchronize
_________________
Martin Prikryl
Guest




prikryl ... I'm not seeing a delete option on the link you gave.

My situation is a little different than nbr_uk's. I'm needing to delete local files after being moved to a remote destination.
In the synchronize dialog box I have:
Direction = Remote
Mode = Synchronize Files
Options = Delete Files, Preview Changes
Comparison Criteria = Modification Time

How do I get the local files to be deleted once moved?

Thanks!!!
Guest




I may have just found the answered to my question, but would like confirmation.

On https://winscp.net/eng/docs/faq_delete_synchronized_files it says "..to generate script to delete the source copies" The way this sounds, WinSCP cannot delete these files on its own.

Thanks!!!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Anonymous wrote:
I may have just found the answered to my question, but would like confirmation.

On https://winscp.net/eng/docs/faq_delete_synchronized_files it says "..to generate script to delete the source copies" The way this sounds, WinSCP cannot delete these files on its own.

Depends on what you want. If you want what nbr_uk asked for, WinSCP can do that:
https://winscp.net/eng/docs/scriptcommand_synchronize

The FAQ is about different task.
_________________
Martin Prikryl
KennethW

Guest


Hello - I have a similar issue where I either would like to have WinSCP return an error code on connection failed (it currently returns zero) or be able to delete local files from within WinSCP script after putting successfully to the remote server. I am calling the WinSCP command line version from a batch file using a WINSCP script.

Is this possible ?

Thanks,
KennethW
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
KennethW wrote:
Hello - I have a similar issue where I either would like to have WinSCP return an error code on connection failed (it currently returns zero)

Are you using the latest version of WinSCP. The latest version should return 1 on any error.
_________________
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