Last active
April 28, 2019 13:51
-
-
Save oripwk/40fcfe1497b677f86953c2ee811809df to your computer and use it in GitHub Desktop.
Restoring WhatsApp files timestamps after Google Drive restore
This file contains 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
# when restoring WhatsApp in a new phone, all the timestamps of media files will be reset to today. | |
# this script will restore the original modification time of the files | |
cd WhatsApp/Media | |
while read path; do | |
f=$(basename "$path"); | |
touch -m -d "${f:4:4}-${f:8:2}-${f:10:2}T12:00:00z" "${path}"; | |
done < <(find . -regextype posix-extended -regex ".*/[[:alpha:]]{3}-[[:digit:]]{8}-.*") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
It was a long time ago. But if I remember correctly, I copied the whole directory to my laptop, ran the script, and then copied it back to the Android phone using ADB.