mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-06-28 03:08:14 +03:00

- Delete script now has an initial one minute delay, to ensure a backup is created first. - Also to prevent this: 
14 lines
323 B
Bash
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."
|