This is basically a follow-on from my last question, now that the VPN is working...
I need to download a set of backup files from a (Windows) server, deleting all but the newest from the server once successfully downloaded.
In other words: - Download all files (re-starting any previously failed downloads and skipping files I already have in full) - Delete all files from the server that are older than X days
The script will run daily. Files vary in size from a few K to a couple of GB (hence the need to remove old files from the server and to avoid re-downloading files I already have).
I looked at lftp which has a "mirror" command that can be scripted and that is able to delete files, but it isn't working quite as expected. (We set it to download all files older than 2 days, deleting on success, then to download all files (no age limit) without deletion. That works fine, but the following day it skips the files it already has and doesn't delete the ones that are now older than 2 days from the server.)
Suggestions?
As it's a Windows server I don't have control of it unfortunately has to be FTP, although if there's a really clever solution that would work with some tweaks[*] on the Windows box I'll put them forward.
[*]Wiping Windows and installing Linux doesn't count as a "tweak" :-(
-- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) @ 13 Clarke Rd, Milton Keynes, MK1 1LG