Skip to content

Instantly share code, notes, and snippets.

@gumblex gumblex/copytime.sh

Created May 22, 2016
Embed
What would you like to do?
Recursively restore file mtime from backup
#!/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
You can’t perform that action at this time.