Jump to content

Using cronjobs.


3raser

Recommended Posts

How would one do this? I searched on google, but it couldn't find a good tutorial. My host allows the option in the control panel for it to set it up for you, but I want to learn the actual coding part just in case I never have the option available.

 

How would I run, say, this script every 4 hours for example?

 

<?php

mysql_query("TRUNCATE logs");

?>

Link to comment
https://forums.phpfreaks.com/topic/228344-using-cronjobs/
Share on other sites

 

Kind of, but why does it say Linux? Also, how do I apply this to my code? Do I make a different file then include it, if so, what extension do I use?

 

Tutorial is not very descriptive.

Link to comment
https://forums.phpfreaks.com/topic/228344-using-cronjobs/#findComment-1177439
Share on other sites

It's says linux, because this cronjob stuff is meant for linux servers. I am pretty sure your server is running on it to.

depending on your admin panel you need to make a file with the stuff in it shown in the article. (that is not a .php filebut it does link to a php which needs to be processed)

Doesn't your host provide a working example on some help forum, some host have there won little tweeks.

 

Ill try to find a more descriptive tutorial, but really google seems to be pretty good at this.

Maybe a good thing to say what the name is of the admin panel.

 

-EDIT:  this is a very descriptive explanation of what cron is: http://www.unixgeeks.org/security/newbie/unix/cron-1.html

 

-EDIT2: http://www.thesitewizard.com/general/set-cron-job.shtml  <----------- i can't explain it better than this.

Link to comment
https://forums.phpfreaks.com/topic/228344-using-cronjobs/#findComment-1177446
Share on other sites

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.