execute a php file once per day

Hi all, I Have a php file in which I have code that does reset on a counter in my mysql database. I would like to have this php file execute everyday at 12:00AM . I am on Arch Linux, with Nginx and php-cgi. I googled this and then found this bit of code :

0 0 * * * /path/to/php /var/www/html/reset.php

but I have no idea how to run it or how to set it in place. can any one help (also is that bit of code that simple? simply include the path to my php and the script)?

p.s. sorry about the duplicate post, i did not intend for that to happen.

3 Replies

You need to set it up as a cron entry. See run PHP script using cron for a bit more background.

@nehalem:

You need to set it up as a cron entry. See run PHP script using cron for a bit more background.
excellent, thank you!

If you do not have the php command available, you'll want to install the php-cli package from your distro's repositories.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct