put latest and delete

Advertisement

jroda74
Guest

put latest and delete

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: put latest and delete

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

Reply with quote

Advertisement

You can post new topics in this forum