This commit is contained in:
Oleg Sheynin 2024-07-19 11:04:30 -04:00
parent 108ae35a06
commit d22d68e03e
2 changed files with 10 additions and 10 deletions

View File

@ -1 +1 @@
0.9.6
0.9.7

View File

@ -3,14 +3,14 @@
Src=${1}
Days=${2}
if [ "${Src}" == "" ]
then
echo "Usage: $0 <source_dir> [<num_days>]"
if [ -z "$Days" ] || [ -z "$Src" ]; then
echo "Usage: $0 <source_dir> <num_days>"
exit 1
fi
if [ "${Days}" == "" ]
then
Days=30
# Add / if Src does not have it (symlinks)
if [ "${Src: -1}" != "/" ]; then
Src="${Src}/"
fi
declare -A Settings=()
@ -27,7 +27,7 @@ echo ${Cmd}
files=($(eval ${Cmd}))
total_files=${#files[*]}
if [[ ${total} == 0 ]]
if [[ ${total_files} == 0 ]]
then
echo "No files found to be pruned. Bye..."
exit 0
@ -38,7 +38,7 @@ duf ${src}
echo "The following files will be removed:"
echo "===================================="
for f in $files ; do echo $f; done
for f in $files ; do ls -l $f; done
echo "===================================="
echo "Total files to be pruned: ${total_files}"