Welcome Guest, Not a member yet? Register   Sign In
Last executed time of a php file
#1

[eluser]The Spider[/eluser]
Hi,
Is there any way to know the time at which a particular php file is executed?
That means, suppose a file named time.php in the server. I want to know the last executed time of this file. Is it possible?

Thanks
#2

[eluser]Thorpe Obazee[/eluser]
you can write to a file whenever it executes.
#3

[eluser]The Spider[/eluser]
Any other way?
#4

[eluser]Thorpe Obazee[/eluser]
[quote author="The Spider" date="1244195236"]Any other way?[/quote]

You could probably do a lot of things to get the information. I'm guessing the answer would depend on how do you plan to use the information.
#5

[eluser]The Spider[/eluser]
There is a cron job executing a file at midnight. I want to know now whether it executed last night.
I am using a linux server.
#6

[eluser]TheFuzzy0ne[/eluser]
Have it send you an Email.
#7

[eluser]Dam1an[/eluser]
[quote author="TheFuzzy0ne" date="1244214208"]Have it send you an Email.[/quote]

I think he's getting at knowing if a file in the past was exacuted (in this case last night) not so he can monitor future executions

Does viewing the detailed list directory not show the last executed/accessed time? (ls -l)
#8

[eluser]mddd[/eluser]
I would create a simple text file to log every time your script executes.
Could be as simple as
Code:
$logfile = fopen('mylogfile.txt','a');
fwrite($logfile, 'My script was executed at' . date('Y-m-d H:i:s');
fclose($logfile);
This will give you a record of all launches, as well as updating the file's timestamp
so you can see if it was changed even just by looking at the 'last changed' date.




Theme © iAndrew 2016 - Forum software by © MyBB