From e808fd593f830b9c04c1a92590d0fbdf95799c07 Mon Sep 17 00:00:00 2001 From: Mads Lundt Date: Sat, 9 Sep 2017 15:12:39 +0200 Subject: [PATCH] Removing empty directories in rmlocal --- scripts/rmlocal | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/rmlocal b/scripts/rmlocal index c701cfb..07e2ef3 100644 --- a/scripts/rmlocal +++ b/scripts/rmlocal @@ -39,6 +39,8 @@ rm_time () { echo "[ $(date ${date_format}) ] Moving file -> ${n} to Google Drive." "${rclone_bin}" move $rclone_options "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 done + + find "${local_decrypt_dir}" -depth -type d -empty -delete } rm_space () { @@ -90,7 +92,9 @@ rm_space () { # Move file to remote destination[s], retaining path echo "[ $(date ${date_format}) ] Moving file -> ${n} to Google Drive. Freeing up ${fileSizeGb} GB" "${rclone_bin}" move $rclone_options "$n" "${rclone_cloud_endpoint}${destpath}" >/dev/null 2>&1 - done + done + + find "${local_decrypt_dir}" -depth -type d -empty -delete } # If script is already running; abort.