-
-
Save eignatov/de957b7b45713ec8a1f4d26223d47479 to your computer and use it in GitHub Desktop.
Delete backups that are x days old (from ftp server)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lftp -u <ftp_user>,<ftp_password> <ftp_host> -e "rm -rf `date --date="3 days ago" '+%Y-%m-%d_'`*; exit" | |
# make sure to escape % for cron: | |
lftp -u <ftp_user>,<ftp_password> <ftp_host> -e "rm -rf `date --date="3 days ago" '+\%Y-\%m-\%d_'`*; exit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment