Topic "put latest and delete"

Author Message
jroda74

Guest


Need help with a script. I need to copy a file from a local source to an ftp site, then delete it from the local source. I then need to move the file on the ftp site from a pending folder to an archive folder. I have this running on a schedule but it moves all the files from the local directory. Tried doing multiple lines with put -delete as well.


option batch abort
option confirm off

open ############## -hostkey="#########################"

synchronize remote -delete "C:\Program Files\Sensus\UMSDataExport\Beacon" /datasync/pending



exit
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
For upload (and delete), use put not synchronize:

put -delete "C:\Program Files\Sensus\UMSDataExport\Beacon\thefile" /datasync/pending/

To move to archive use:

mv /datasync/pending/thefile /archive/thefile
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