J
joe shaboo
Hi,
I'm trying to list files that are 4 days old, and then perform an
action on them. I don't care about any files that are newer (have been
edited or touched in the last 4 days), only 4 days or older.
I can do this either through SHELL or perl, which ever is easier.
For example
ls -lt d.* | awk '{print $6 $7}' Provides a list of just of the date
of the files. What I would like to do is, if a file has been touched
in the last 4 days, grep for a certain term, and if it exists, pipe to
a file.
I was thinking of doing something like subtracting the day of the
month from system date, but then I run into problems in the first 4
days of the month.
If someone can think of a way to do this, I would be grateful.
Many Thanks,
Joe
I'm trying to list files that are 4 days old, and then perform an
action on them. I don't care about any files that are newer (have been
edited or touched in the last 4 days), only 4 days or older.
I can do this either through SHELL or perl, which ever is easier.
For example
ls -lt d.* | awk '{print $6 $7}' Provides a list of just of the date
of the files. What I would like to do is, if a file has been touched
in the last 4 days, grep for a certain term, and if it exists, pipe to
a file.
I was thinking of doing something like subtracting the day of the
month from system date, but then I run into problems in the first 4
days of the month.
If someone can think of a way to do this, I would be grateful.
Many Thanks,
Joe