Created
May 19, 2017 19:05
-
-
Save dubcl/b95acb0b280bf4c7e1548077738368bc to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# | |
# Compress bak files from qbiz server | |
# and delete files older than 30 days | |
# | |
# Carlos Albornoz <caralbornozc@gmail.com> | |
DIR=/opt/backup | |
cd $DIR | |
for FILE in $(ls *.bak); | |
do | |
gzip $FILE; | |
done | |
find . -mtime +20 -type f -name "*.bak.gz" -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment