Hi !
Please, how could a counter be added to know the number of files that the cycle is going to delete?
Thanks.
Please, how could a counter be added to know the number of files that the cycle is going to delete?
Code:
{:global datetime2epoch/system clock:local now [$datetime2epoch ("$[get date] $[get time]")]:local wait 2592000 ; # seconds, 1 month:local fdate 0:local countFiles /file:foreach file in=[find where type~"backup|script" && name~"usb1"] do={ :set fdate [$datetime2epoch [get $file creation-time]] :if ($sdate) do={ :set countFiles [print count-only where .id=$file] # remove $file }}:put $countFiles:log info "[ $countFiles ] backup files have been deleted"}
Statistics: Posted by diamuxin — Sat Mar 16, 2024 9:13 pm