I have some folder with files with the names as "example_YY_MM_DD-HH.zip" and I have 3 backups per day. I need this:
1) For backups older than 1 week I need only one per day (at midnight '00' at HH)
2) For backups older than month I need only one backup per week.
3) For backups older than one year I need only one backup per month (first day of month)
I have only this and I dont know what put to IF part.
Thanks
#!/bin/sh
export NOW=$(date +"%d-%m-%Y")
export OUTPUT=/media/backup/logs/delete-old.txt
export BACKUP_DIR=
for file in $BACKUP_DIR
do
if $file
fi
done