From b50a1bcae24094bca419a4bb0863d551e182b82e Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 13 Nov 2025 13:10:30 +0300 Subject: [PATCH] fix cleanup-directory function --- home/user/.local/bin/cleanup-directory | 2 +- home/user/.local/bin/cleanup-directory-log | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home/user/.local/bin/cleanup-directory b/home/user/.local/bin/cleanup-directory index eb63fe3..04bc184 100755 --- a/home/user/.local/bin/cleanup-directory +++ b/home/user/.local/bin/cleanup-directory @@ -11,7 +11,7 @@ if [ ! -d "${directory}" ]; then return 1 fi -if [ -n "${DRYRUN}" ]; then +if [ -n "${DRYRUN:-}" ]; then echo "Deleting files not accessed for a ${age} days:" find "${directory}" -mindepth 1 -atime "${age}" -not -type d -not -name cleanup.log diff --git a/home/user/.local/bin/cleanup-directory-log b/home/user/.local/bin/cleanup-directory-log index f5d74c5..c346cec 100755 --- a/home/user/.local/bin/cleanup-directory-log +++ b/home/user/.local/bin/cleanup-directory-log @@ -12,7 +12,7 @@ fi readonly log_file="${directory}/cleanup.log" -if [ -n "${DRYRUN}" ]; then +if [ -n "${DRYRUN:-}" ]; then log_file="/dev/null" fi