This commit is contained in:
Oleg Sheynin 2024-07-19 10:45:46 -04:00
parent 2416a5a77e
commit 108ae35a06
2 changed files with 13 additions and 4 deletions

View File

@ -1 +1 @@
0.9.5
0.9.6

View File

@ -20,18 +20,27 @@ Settings[PruneDate]=$(date -d "${Days} days ago" '+%Y-%m-%d')
src=${Settings[Src]}
prune_date=${Settings[PruneDate]}
echo Before Pruning....
duf ${src}
echo "Finding files older than ${prune_date}..."
Cmd="find ${src} -type f ! -newermt \"${prune_date}\""
echo ${Cmd}
files=($(eval ${Cmd}))
total_files= ${#files[*]}
if [[ ${total} == 0 ]]
then
echo "No files found to be pruned. Bye..."
exit 0
fi
echo Before Pruning....
duf ${src}
echo "The following files will be removed:"
echo "===================================="
for f in $files ; do echo $f; done
echo "===================================="
echo "Total files to be pruned: ${#files[*]}"
echo "Total files to be pruned: ${total_files}"
Cmd="${Cmd} -delete"
echo ${Cmd}