3raser Posted February 21, 2011 Share Posted February 21, 2011 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"); ?> Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted February 21, 2011 Share Posted February 21, 2011 is this link usefull? http://www.devdaily.com/linux/unix-linux-crontab-every-minute-hour-day-syntax Quote Link to comment Share on other sites More sharing options...
3raser Posted February 21, 2011 Author Share Posted February 21, 2011 is this link usefull? http://www.devdaily.com/linux/unix-linux-crontab-every-minute-hour-day-syntax 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. Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted February 21, 2011 Share Posted February 21, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.