From 34d14b6851c95c0ba9059d247d880e33012105dc Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Wed, 20 Nov 2024 11:24:39 +0200 Subject: [PATCH] add debug --- fix_dir_dates.sh | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 fix_dir_dates.sh diff --git a/fix_dir_dates.sh b/fix_dir_dates.sh old mode 100644 new mode 100755 index 800d644..4321446 --- a/fix_dir_dates.sh +++ b/fix_dir_dates.sh @@ -1,8 +1,12 @@ #!/bin/bash while read -r dir do + echo "Checking dir '${dir}'..." last_file=$(ls -ht -- "${dir}" | head -n1) + echo "Last modified file is '${last_file}'" last_file_time=$(stat -c %Y -- "${last_file}") + echo "Last modification time of the file is '${last_file_time}'" last_file_time_formated=$(date -d "@${last_file_time}" +%Y%m%d%H%M.%S) + echo "Last modification time formated is '${last_file_time_formated}'" touch -a -m -t "${last_file_time_formated}" -- "${dir}" done <<< "$(find . -mindepth 1 -maxdepth 1 -type d)"