* Consolidated solution on finding current date files.
@ 1998-05-08 7:08 Sundar_Rajan
0 siblings, 0 replies; only message in thread
From: Sundar_Rajan @ 1998-05-08 7:08 UTC (permalink / raw)
To: tru64-unix-managers
Hello All,
Solution is finally found. Thanx for all who helped and tried helping.
I would like to distribute the compiled solutions from different sources.
Hope it will be useful sometimes.
Soln 1
ls -lR | grep "$TODAY"
Soln 2
if ($key!=""){
$key = Chop(ereg_replace("( )+"," ",$key));
// replace one or more spaces with only one
if ($key[0]==' ') $key =
substr($key,1,strlen($key)-1);
// remove leading space
}
Soln 3
ls -la | grep -E 'May[[:space:]]*7'
Soln 4
touch -t `date +%m%d0000` /tmp/midnight
find $dir -newer /tmp/midnight -print
Soln 5
touch /tmp/this_backup
find $dir -newer /tmp/last_backup -print | whatever
# do your backup.
# If successful:
mv -f /tmp/this_backup /tmp/last_backup
Soln 6
% touch -t `date +%m%d`0000 today.key
% ls -l today.key
-rw-r----- 1 yakoshi system 0 May 7 00:00 today.key
% find . -newer today.key -print
.
./Mail/inbox
./Mail/inbox/1
:
% find . -newer today.key -type f -exec ls -l {} \;
-rw------- 1 yakoshi system 355 May 7 12:15 ./Mail/inbox/1
:
Soln 7
find . -mtime -1 -print
Soln 8
month=May
day=7
success=0
ls -lR | while read output; do
set -A field $output
[[ ${field[5]} = $month ]] && [[ ${field[6] = $day ]] && {
success=1
break
}
done
awk
ls -lR | awk '$6 = "'"$month"'" && $7 == "'"$day"'"' # prints
matches
Soln 9
touch -t 980506115959 /tmp/somefile
find /somedir -newer /tmp/somefile
Soln 10
TODAY_DAY='7'
TODAY-MONTH='May'
ls -lR | egrep "${MONTH} [ ]*${DAY}"
Sunder
P.S : Please ignore the autosignature below
********************************************************************
The information contained in these documents may be confidential and is intended
for the exclusive use of the addressee designated above. If you are not the
addressee, any disclosure, reproduction, or other dissemination or use of this
communication is strictly prohibited. If you have received this transmission in
error please contact us immediately by telephone so that we can arrange for its
return.
********************************************************************
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-05-08 7:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-08 7:08 Consolidated solution on finding current date files Sundar_Rajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox