Created
May 22, 2016 04:21
-
-
Save gumblex/5d052064f56c2dcd263edb3e805fbd3a to your computer and use it in GitHub Desktop.
Recursively restore file mtime from backup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -type f -print0 | while IFS= read -r -d $'\0' filename; do | |
if [ -f "$1/$filename" ]; then | |
echo touch -r "$1/$filename" "$filename" | |
touch -r "$1/$filename" "$filename" | |
else | |
echo "$1/$filename" not exist | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment