add dir times fix
This commit is contained in:
parent
aedd0e5e04
commit
b51452d53e
1 changed files with 8 additions and 0 deletions
8
fix_dir_dates.sh
Normal file
8
fix_dir_dates.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
while read -r dir
|
||||
do
|
||||
last_file=$(ls -- "${dir}" -ht | head -n1)
|
||||
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)"
|
Loading…
Reference in a new issue