|
46 |
local max_age="${arg_max_age:-$backup_clean_max_age}" |
46 |
local max_age="${arg_max_age:-$backup_clean_max_age}" |
47 |
|
47 |
|
48 |
if [ -n "$max_age" ]; then |
48 |
if [ -n "$max_age" ]; then |
49 |
echo find "$backup_dir" -type f -mtime "+$max_age" -regex "$pattern" |
49 |
echo "find '$backup_dir' -type f -mtime '+$max_age' -regex '$pattern'" |
50 |
local count=$(find "$backup_dir" -type f -mtime "+$max_age" -regex "$pattern" | wc -l) |
50 |
local count=$(find "$backup_dir" -type f -mtime "+$max_age" -regex "$pattern" | wc -l) |
51 |
if [ "$count" -ge "${backup_clean_min_backups:-10}" ]; then |
51 |
if [ "$count" -ge "${backup_clean_min_backups:-10}" ]; then |
52 |
find "$backup_dir" -type f -mtime "+$max_age" -regex "$pattern" -delete |
52 |
find "$backup_dir" -type f -mtime "+$max_age" -regex "$pattern" -delete |