15 lines
290 B
Bash
Executable file
15 lines
290 B
Bash
Executable file
#!/usr/bin/env bash
|
|
file="$1"
|
|
dir="${2:-./dates}"
|
|
|
|
threshold=$(( 8 * 24 * 3600 )) # eight days
|
|
|
|
if [ -z "$file" ]; then
|
|
echo "filename not specified" >2
|
|
echo "usage: $0 <filename> [<dirname>]" >2
|
|
exit 255
|
|
fi
|
|
|
|
(( ($(stat -c%Y "$dir/$file") + threshold) > $(date +%s) )) || exit 1
|
|
|
|
exit 0
|