Don't try to delete files when deleting empty directories.

This commit is contained in:
tastytea 2021-02-10 12:22:34 +01:00
parent 4462676df1
commit 8fa4e9f903
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ function main()
[[ -z "${max_videos}" ]] && local max_videos="last"
find "${download_dir}" -type f -mtime +"${keep_for_days}" -delete
rmdir --ignore-fail-on-non-empty "${download_dir}"/*
find "${download_dir}" -type d -maxdepth 1 -exec \
rmdir --ignore-fail-on-non-empty {} \;
mkdir -p "${download_dir}"
local files_before="$(find "${download_dir}" -type f)"