Jump to content

Where do I put CRON code


Peggy

Recommended Posts

So I've figured out alot about how to automatically run a php function. I can't figure out where to put the CRON code do I put it in the header between the head tags? do I put it before any html code? Am I right in assuming that All I have to do  is --put it in the right place-- then upload it to the server. Also I have to put executable permissions on the delete_old_count.php

I have this set for 11:30 tonight. (as a test).

 

#!/usr/local/bin/php -q 

30 23 15 10 * auto_functions/delete_old_count.php

Link to comment
https://forums.phpfreaks.com/topic/177835-where-do-i-put-cron-code/
Share on other sites

okay please excuse me for being a little slow.

I put this code:

30 23 15 10 * auto_functions/delete_old_count.php

on a separate page with the extension of what?

Or do I stick it on an existing page? Sorry I don't get it.

 

Also  this code:

#!/usr/local/bin/php -q

goes on the page  delete_old_count.php    Does it go at the top of the page before the php tags? :shrug:

I put this code:

30 23 15 10 * auto_functions/delete_old_count.php

on a separate page with the extension of what?

Or do I stick it on an existing page? Sorry I don't get it.

 

That is not code, it is simply a cron directive. It needs to go within your crontab file. You can access this file by issuing...

 

crontab -e

 

to the terminal.

 

Then yes, the shbang line needs to be the very first line within your script. it tells the shell what program to use to execute the script. linux doesn't care about file extensions.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.