Topic "Synchronize local with "get -delete" on remote"

Author Message
lnedad

Guest


Is there an easy way to use synchronize to get all the new files in a remote directory and then delete them once they are on the local directory. (Also, I never want to delete files from the local directory).
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
What would you use such function for?
_________________
Martin Prikryl
log10
[View user's profile]

Joined: 2008-09-14
Posts: 1
prikryl wrote:
What would you use such function for?


I have hundreds of log files that need to be downloaded from different servers. I would like to download them if they don't exist or are not changed on the local server and delete them on the remote server once they are "safely" on the local server.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
So once you do that (e.g. manually), you will end up with no remote files. So the next times you just need to do "get -delete". Right?
_________________
Martin Prikryl
AoR

Guest


Hello

I have a little problem by using the "get" command within a scripting file. If I use get in this way

get -delete *.csv \\Server-name\directory\

I get an error like

. 2009-01-14 12:00:43.278 Getting current directory name.
. 2009-01-14 12:00:43.278 Listing file "-delete".
> 2009-01-14 12:00:43.278 Type: SSH_FXP_LSTAT, Size: 39, Number: 263
< 2009-01-14 12:00:43.278 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-01-14 12:00:43.278 Status/error code: 2, Message: 263, Server: No such file, Language:
. 2009-01-14 12:00:43.278 Closing connection.

Which is the correct way to use the "-delete" Switch?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
AoR wrote:
Which is the correct way to use the "-delete" Switch?

You are using it correctly. However you probably use old version of WinSCP. Switches such as -delete are supported since WinSCP 4.1 only.
_________________
Martin Prikryl
AoR

Guest


Thanxs! Now it works!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
I have added topic on deleting files after synchronization to FAQ.
_________________
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