1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-06-28 03:08:14 +03:00
vwdump/delete.sh
jmqm 0fb7abc0c1
Delay delete
- Delete script now has an initial one minute delay, to ensure a backup is created first.
  - Also to prevent this:
    ![image](https://user-images.githubusercontent.com/68612932/126045649-e737136f-80b0-4727-80fc-c7872812997c.png)
2021-07-17 12:50:53 -05:00

14 lines
323 B
Bash

#!/bin/sh
# Sleep for one minute to ensure a backup is made first.
sleep 1m
# Go to the backups directory.
cd /backups
# Delete tar.xz archives older than x days.
find . -iname "*.tar.xz" -type f -mtime +$DELETE_AFTER -exec rm -f {} \;
# Echo that script ran.
echo "[INFO] Deleted files older than $DELETE_AFTER days."