Topic "Change from Synchronization to Upload & Delete?"

Author Message
BCT-Tech
[View user's profile]

Joined: 2017-01-26
Posts: 2
Location: CA
We are synchronizing files from our local Server to an SFTP Server every 5 min via Scheduled Task.

What do we need to change to keep the local and remote folder structure, upload files only and delete local files after?

This is our current script:

Batch file:
WinSCP.com /script=Upload2SFTP.txt

Upload2SFTP.txt:
open sftp://server.com -hostkey="ssh-rsa 1024 a3:63:9a:f9:33:90:91:97:f5:60:f2:c5:ba:c8:5d:04"
synchronize remote "D:\Share\" "/users/OurUser/"
exit
BCT-Tech
[View user's profile]

Joined: 2017-01-26
Posts: 2
Location: CA
Do we just change: synchronize remote "D:\Share\" "/users/OurUser/"
To: put -delete "D:\Share\" "/users/OurUser/"

Or: put -delete "D:\Share\*.*" "/users/OurUser/"
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26711
Location: Prague, Czechia
No, it's way more complicated, if you need to keep the directory structure.
See https://winscp.net/eng/docs/library_example_moves_files_keeping_directory_structure
Advertisements

You can post new topics in this forum

Search

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