}
# Clean up old backups
-function clean_dumps() {
- find /var/lib/pgsql/backups '(' -name "$PLC_DB_NAME.*.sql" -o -name "drupal.*.sql" ')' -a -atime +15 | xargs rm -f
+function clean_dump() {
+ local days="$1"; shift
+ [[ -z "$days" ]] && days=15
+ find /var/lib/pgsql/backups '(' -name "${PLC_DB_NAME}*.sql" -o -name "drupal*.sql" ')' -a -mtime +$days | xargs rm -f
check
}
clean-dump)
MESSAGE=$"Cleaning old database dumps"
dialog "$MESSAGE"
-
- clean_dumps
+ # clean_dump has a builtin default, so no problem
+ clean_dump $2
result "$MESSAGE"
;;