diff --git a/misc/rmexpfiles.sh b/misc/rmexpfiles.sh index 2ba10aab..881f44f8 100644 --- a/misc/rmexpfiles.sh +++ b/misc/rmexpfiles.sh @@ -8,7 +8,7 @@ duration=$2 find $filepath -maxdepth 1 -type f -name "*[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]*" -printf "%f\n" | while read filename; do datestr=$(echo "$filename" | grep -oE '[0-9]{8}') filedate=$(date -d "$datestr" +%s) - sevendaysago=$(date -d "$duration days ago' +%s) + sevendaysago=$(date -d "$duration days ago" +%s) if [ "$filedate" -lt "$sevendaysago" ]; then rm -f "$filepath/$filename" echo "rm file: $filename"