Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get execution date or / and time 2

Status
Not open for further replies.

gerardus

Technical User
Feb 6, 2002
13
0
0
NL
Hi,

We have hundreds of ksh scripts on our machines. I want to know the last date these scripts are executed. Is there any command to do this??

G.
 
Geradus,

You can use a command called istat:

istat <filename>

The output will be similar to the following:

Last updated: Wed Jan 08 17:02:12 2003
Last modified: Wed Jan 08 17:02:12 2003
Last accessed: Wed Jan 08 17:02:30 2003

The last accessed time will tell you when it was last executed.

Cheers

PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
Time last accessed is backup time. Backup time is last night. This is not the time when it was last executed!

G.
 
geradus,

Well of course the i-node is updated when anything references the file - so the time last accessed is the time the file was last accessed, hence the name....as your backup reads the file everynight there is no way to find out when it was last executed. If you had not backed up the file then the time last accessed would be when it was last executed if the updated and modified time were not updated at the same time.

Cheers

PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
What is the difference between updated and modified ? How to know when the file was created ?

Thanks.
Raj.
 
rraj,

Last updated = Date of the last i-node update

Last modified = Date of the last file modification

The difference between the two - if you vi a file and save it both fields are updated as you have modified the file and updated the i-node. If you chmod/chown the file then only last updated is changed because you are only updating the i-node and not changing the file.

Cheers

PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top