Created
August 8, 2014 09:34
-
-
Save cschell/086867e61d87ec6a2bf4 to your computer and use it in GitHub Desktop.
Delete backups that are x days old (from ftp server)
This file contains hidden or 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