2024-11-20 10:22:26 +01:00
|
|
|
#!/bin/bash
|
|
|
|
while read -r dir
|
|
|
|
do
|
2024-11-20 10:22:59 +01:00
|
|
|
last_file=$(ls -ht -- "${dir}" | head -n1)
|
2024-11-20 10:22:26 +01:00
|
|
|
last_file_time=$(stat -c %Y -- "${last_file}")
|
|
|
|
last_file_time_formated=$(date -d "@${last_file_time}" +%Y%m%d%H%M.%S)
|
|
|
|
touch -a -m -t "${last_file_time_formated}" -- "${dir}"
|
|
|
|
done <<< "$(find . -mindepth 1 -maxdepth 1 -type d)"
|