Mark Rogers
2013-06-06 15:44:40 UTC
I have a need to download files via FTP from a host, deleting old backups on
the host but retaining recent ones. In other words, we want to archive all
backups off the host, and only leave the last one or two days of backups on
the host.
I have never used lftp before but it looked like I could so something like this:
- Download (using "mirror -c") all files more than 2 days old
(--older-than=2days), deleting them on success (--remove-source-files)
- Download again but without the --older-than and --remove-source-files
switches to download everything else, without deleting it
This works on day 1, but when it runs the next day it skips the files it
already has and doesn't delete them (even if they're now more than 2 days old).
Is this by design, or a bug? Is there a way to work around this?
I'm using the version in the Ubuntu 12.04 LTS repositories (4.3.3) if that
makes a difference.
the host but retaining recent ones. In other words, we want to archive all
backups off the host, and only leave the last one or two days of backups on
the host.
I have never used lftp before but it looked like I could so something like this:
- Download (using "mirror -c") all files more than 2 days old
(--older-than=2days), deleting them on success (--remove-source-files)
- Download again but without the --older-than and --remove-source-files
switches to download everything else, without deleting it
This works on day 1, but when it runs the next day it skips the files it
already has and doesn't delete them (even if they're now more than 2 days old).
Is this by design, or a bug? Is there a way to work around this?
I'm using the version in the Ubuntu 12.04 LTS repositories (4.3.3) if that
makes a difference.
--
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER