delete just files that were transferred
This is well after the fact but thought I'd put it out here in case someone has a similar problem.
I need to do something very similar to what Michael describes but don't have rights to create directories on the remote server.
In my case, file names are well defined such as I need to pick up pickup*.txt (and I'll be dropping off files named like droppedoff*.txt which I can ignore). I do a mv to a new name format such as a new extension and in the get can switch the destination extension back so my local files are the expected extension still.
mv pickup*.txt pickup*.get
get pickup*.get pickup*.txt
rm pickup*.get
Assuming the other end is always putting pickup files with .txt extensions and never .get extensions (in other words I always control what is named .get) then only items at the time of the mv will be dealt with on the get and the rm and any new files during my connection will be .txt and ready for the next time I run the script.
This at least handle doing the get and the rm to the same set of files.
I need to do something very similar to what Michael describes but don't have rights to create directories on the remote server.
In my case, file names are well defined such as I need to pick up pickup*.txt (and I'll be dropping off files named like droppedoff*.txt which I can ignore). I do a mv to a new name format such as a new extension and in the get can switch the destination extension back so my local files are the expected extension still.
mv pickup*.txt pickup*.get
get pickup*.get pickup*.txt
rm pickup*.get
Assuming the other end is always putting pickup files with .txt extensions and never .get extensions (in other words I always control what is named .get) then only items at the time of the mv will be dealt with on the get and the rm and any new files during my connection will be .txt and ready for the next time I run the script.
This at least handle doing the get and the rm to the same set of files.