Skip to content

Commit

Permalink
Merge pull request #1550 from dinger1986/develop
Browse files Browse the repository at this point in the history
changed find and delete of old backups
  • Loading branch information
wh1te909 committed Jul 6, 2023
2 parents 6fe4c5a + bc4329a commit c2b2f4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

SCRIPT_VERSION="25"
SCRIPT_VERSION="26"

GREEN='\033[0;32m'
YELLOW='\033[1;33m'
Expand Down Expand Up @@ -114,9 +114,9 @@ if [[ $* == *--auto* ]]; then

rm -rf ${tmp_dir}

find /rmmbackups/daily/ -maxdepth 1 -mtime +14 -type d -exec rm -rv {} \;
find /rmmbackups/weekly/ -maxdepth 1 -mtime +60 -type d -exec rm -rv {} \;
find /rmmbackups/monthly/ -maxdepth 1 -mtime +380 -type d -exec rm -rv {} \;
find /rmmbackups/daily/ -type f -mtime +14 -name '*.tar' -execdir rm -- '{}' \;
find /rmmbackups/weekly/ -type f -mtime +60 -name '*.tar' -execdir rm -- '{}' \;
find /rmmbackups/monthly/ -type f -mtime +380 -name '*.tar' -execdir rm -- '{}' \;
echo -ne "${GREEN}Backup Completed${NC}\n"
exit

Expand Down

0 comments on commit c2b2f4d

Please sign in to comment.