Created
February 6, 2015 04:39
-
-
Save rossigee/44b9287e95068ebb9ae1 to your computer and use it in GitHub Desktop.
Checks number of seconds since a file was changed
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 | |
# | |
# Returns (via stdout) the number of seconds since a file was last changed. Useful for checking a | |
# 'success' timestamp/flag file to identify a stale/dead process. | |
# | |
echo $[`date +%s` - `stat -c %Y $1`] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment