Last active
December 20, 2015 07:09
-
-
Save dfreniche/6090995 to your computer and use it in GitHub Desktop.
A small bash script to find all files with wrong date (1 Jan 1970) and set to current date. Tested in Mac (OS X 10.8) but should work in other UNIXes
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
#!/bin/bash | |
#update-date.sh: a small script to find all files with wrong date (1 Jan 1970) and set to current date | |
COMP_FILE=$HOME/comp_file_delete_me | |
touch -t 197001020101 $COMP_FILE | |
echo Comparing with $COMP_FILE | |
echo Obtaining list of files with wrong date. Will take some time… | |
find ./ -depth -type f -not -newer $COMP_FILE -print -exec touch {} \; | |
rm $COMP_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment