mtime -2
will find last 48 hours which could include the day before yesterday e.g.
Code:
# ls -l
total 5
drwxr-xr-x 2 root root 288 Apr 5 10:34 .
drwxrwxrwt 20 root root 864 Apr 5 10:31 ..
-rw-r--r-- 1 root root 0 Apr 3 03:59 f0
-rw-r--r-- 1 root root 0 Apr 3 23:09 f1
-rw-r--r-- 1 root root 0 Apr 3 23:59 f2
-rw-r--r-- 1 root root 0 Apr 4 00:00 f3
-rw-r--r-- 1 root root 0 Apr 4 12:00 f4
-rw-r--r-- 1 root root 0 Apr 4 23:59 f5
-rw-r--r-- 1 root root 0 Apr 5 00:00 f6
-rw-r--r-- 1 root root 0 Apr 5 03:59 f7
-rw-r--r-- 1 root root 0 Apr 5 10:20 f8
-rwxr-xr-x 1 root root 224 Apr 5 10:29 t1
# date
Wed Apr 5 10:48:12 SAST 2006
# find . -mtime -2 -mmin +200 -ls
150012 0 -rw-r--r-- 1 root root 0 Apr 3 23:09 ./f1
150054 0 -rw-r--r-- 1 root root 0 Apr 3 23:59 ./f2
150062 0 -rw-r--r-- 1 root root 0 Apr 4 00:00 ./f3
171447 0 -rw-r--r-- 1 root root 0 Apr 4 12:00 ./f4
171448 0 -rw-r--r-- 1 root root 0 Apr 4 23:59 ./f5
171449 0 -rw-r--r-- 1 root root 0 Apr 5 00:00 ./f6
171456 0 -rw-r--r-- 1 root root 0 Apr 5 03:59 ./f7
Try this instead (and you don't need grep "$todaydat")
Code:
# touch -t 200604032359.59 /tmp/reffile.$$
# find . -newer /tmp/reffile.$$ -mmin +200 -exec echo {} \;
./f3
./f4
./f5
./f6
./f7
# rm /tmp/reffile.$$
OR
Code:
# yd=$(date -d "yesterday"|cut -c 5-10)
# td=$(date |cut -c 5-10)
# find . -mtime -2 -mmin +200 -ls | egrep "$yd|$td" | awk '{print $11}'
./f3
./f4
./f5
./f6
./f7