summaryrefslogtreecommitdiffstats
path: root/tests/common/mtime.sh
blob: 7ba127e29d6604e68e8888dcafbe6318d9d909e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cd "$TEST"

now=$(epoch_time)

"$XTOUCH" -mt "@$((now - 60 * 60 * 24 * 7))" last_week
"$XTOUCH" -mt "@$((now - 60 * 60 * 49))" two_days_ago
"$XTOUCH" -mt "@$((now - 60 * 60 * 25))" yesterday
"$XTOUCH" -mt "@$((now - 60 * 60))" one_hour_ago
"$XTOUCH" -mt "@$((now))" now
"$XTOUCH" -mt "@$((now + 60 * 60 * 24))" tomorrow

bfs_diff -mindepth 1 \
    \( -mtime -1 -exec printf -- '-mtime -1: %s\n' {} \; -o -true \) \
    \( -mtime  1 -exec printf -- '-mtime  1: %s\n' {} \; -o -true \) \
    \( -mtime +1 -exec printf -- '-mtime +1: %s\n' {} \; -o -true \)