Simple script to delete backup file which is 7 days older than today within the same Month and Year
#!/bin/bash
# Backup Filename : Backup_$(date +"%d-%m-%Y_%H%M%S").tar.bz2
set $(date +"%m %Y");
# Exec
/usr/bin/find /var/backup -type f -name 'Backup_*-'$1'-'$2'_*.tar.bz2' -mtime +7 -exec rm {} \;
# Logging
echo "Rotating Backup at : $( date +"%d-%m-%Y %H:%M:%S" )" | tee -a /var/log/messages
Subscribe to:
Post Comments (Atom)
40 Hadist Seputar Keluarga Samawa (Bagian 3)
﷽ Ustadz Yusuf Abu Ubaidah As-Sidawi hafizahullohuta'ala Masjid Al-Aziz Jl. Soekarno Hatta No. 662 Bandung Hadist 11 : Doa Orangtua Bu...
-
﷽ This is just a 5 minutes article on howto install Anydesk on Debian based Linux (Kali/Parrot/Ubuntu). # Update and preparation : $ s...
-
﷽ Walkthrough WebGoat Assignment Crypto Basics #8 : First run the docker as requested : docker run -d webgoat/assignments:findthesecret ...
No comments:
Post a Comment