touched files - Unix
This is a discussion on touched files - Unix ; i have this file which is like and error file and it gets written to
different/multipule times a day (its always different day to day) i
tried to put together a simple script using find to determine if it got
...
-
touched files
i have this file which is like and error file and it gets written to
different/multipule times a day (its always different day to day) i
tried to put together a simple script using find to determine if it got
written to. unfortunately -atime -mtime and -ctime just keep picking up
on the file every 15 mins (job runs every 15) cause the date is of the
current day. i need it to look at the 24 hour time stamp as well as
date. is there a very simple and basic way of doing it?
-
Re: touched files
jdunphy schrieb:
> i have this file which is like and error file and it gets written to
> different/multipule times a day (its always different day to day) i
> tried to put together a simple script using find to determine if it got
> written to. unfortunately -atime -mtime and -ctime just keep picking up
> on the file every 15 mins (job runs every 15) cause the date is of the
> current day. i need it to look at the 24 hour time stamp as well as
> date. is there a very simple and basic way of doing it?
>
create a timestamp to which you can compare the file, then run this command:
find /full/path/to/error/file -newer /some/directory/timestamp
touch /some/directory/timestamp
this will output your file name, if the file has been modified since the
last run of the script. Naturally, you should initialise the script with
a simple touch ....
Hope, this helps
--
------------------------------
Dipl.-Inf. Klaus-Dieter Ost
kdo@no-spam-to-smo.de
Unix Solaris AIX - C++ Java sh
Software Design Documentation
------------------------------