mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Backup cleanup
This commit is contained in:
@ -170,7 +170,7 @@ The `./gravity-sync.sh config` function will attempt to ping the remote host to
|
|||||||
Default setting in Gravity Sync is 0, change to 1 to skip this network test.
|
Default setting in Gravity Sync is 0, change to 1 to skip this network test.
|
||||||
|
|
||||||
#### `BACKUP_RETAIN=''`
|
#### `BACKUP_RETAIN=''`
|
||||||
The `./gravity-sync.sh backup` function will retain a defined number of previous `gravity.db` and `custom.list` backups.
|
The `./gravity-sync.sh backup` function will retain a defined number of days worth of `gravity.db` and `custom.list` backups.
|
||||||
|
|
||||||
Default setting in Gravity Sync is 7, adjust as resired.
|
Default setting in Gravity Sync is 7, adjust as resired.
|
||||||
|
|
||||||
|
@ -1627,6 +1627,12 @@ function task_backup {
|
|||||||
|
|
||||||
cp ${PIHOLE_DIR}/${CUSTOM_DNS} $HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/${BACKUPTIMESTAMP}-${CUSTOM_DNS}.backup
|
cp ${PIHOLE_DIR}/${CUSTOM_DNS} $HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/${BACKUPTIMESTAMP}-${CUSTOM_DNS}.backup
|
||||||
error_validate
|
error_validate
|
||||||
|
|
||||||
|
MESSAGE="Cleaning Up Old Backups"
|
||||||
|
echo_stat
|
||||||
|
|
||||||
|
find $HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/$(date +%Y)*.backup -mtime +${BACKUP_RETAIN} -type f -delete
|
||||||
|
error_validate
|
||||||
|
|
||||||
exit_withchange
|
exit_withchange
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user