From 6fe23761abebdc8393951293ad69e885a431048b Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Sat, 28 Oct 2023 16:10:02 +0800 Subject: [PATCH] fix: rmexpfiles.sh --- misc/rmexpfiles.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"