echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)"
}
-# Remove all locks
-function remove_locks() {
- rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW
+# Remove daily lock
+function remove_daily_lock() {
+ rm -f $LOCK_DAILY
}
-# trap handler for cleaning up on signal / error
-function cleanup() {
- remove_locks
+# Remove all locks
+function remove_all_locks() {
+ rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW
}
# If we error out this one is called, *FOLLOWED* by cleanup above
cd $base/backup/
find -maxdepth 1 -mindepth 1 -type f -name 'dump_pre_*' -mtime +2 -print0 | xargs -0 --no-run-if-empty rm
- find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mmin +720 |
+ find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' \! -name '*.xz' -mmin +720 |
while read dumpname; do
echo "Compressing $dumpname"
bzip2 -9fv "$dumpname"
done
- find -maxdepth 1 -mindepth 1 -type f -name "dumpall_*" \! -name '*.bz2' \! -name '*.gz' -mmin +720 |
+ find -maxdepth 1 -mindepth 1 -type f -name "dumpall_*" \! -name '*.bz2' \! -name '*.gz' \! -name '*.xz' -mmin +720 |
while read dumpname; do
echo "Compressing $dumpname"
bzip2 -9fv "$dumpname"