affordit Posted January 26, 2008 Share Posted January 26, 2008 From what I read a cronjob will run automatically based on what I specify in the file is that right? If it is, is there somewhere special that the job should be placed in my directory so that it will be executed or what. I have some code I would like to run everyday but I am not sure where to put them to make it happen. Can someone point me in the right direction Please. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/ Share on other sites More sharing options...
Aureole Posted January 26, 2008 Share Posted January 26, 2008 If you have cPanel - Advanced > Cron Jobs > Experience Level > Standard Command to run: /usr/local/bin/php -q /home/veraci7y/public_html/folder/cron/script.php ...for example. Then just choose the times and what-not. If you don't have cPanel, then I don't know. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449777 Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 as the above example use full paths, than it dun matter where yer script is. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449778 Share on other sites More sharing options...
affordit Posted January 26, 2008 Author Share Posted January 26, 2008 I don't know if I have cPanel or not My domain is hosted by Yahoo small business and I have not been able to get an answer out of them yet. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449783 Share on other sites More sharing options...
Aureole Posted January 26, 2008 Share Posted January 26, 2008 www.yourdomain.com/cpanel If you get a 404 Page then you don't have cPanel, otherwise you do... Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449787 Share on other sites More sharing options...
affordit Posted January 26, 2008 Author Share Posted January 26, 2008 /usr/local/bin/php -q /home/veraci7y/public_html/folder/cron/scriptname.php Where would I run the above code from? Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449789 Share on other sites More sharing options...
affordit Posted January 26, 2008 Author Share Posted January 26, 2008 OK apparently I don't have cpanel got an error Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449791 Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 u can always check where yer scripts are <?php header("Content-type: text/plain"); echo "working path: ". get_cwd(); echo "php path: ". system("find php"); ?> this shud work fine in linux environments, windows will fail on the find php command. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449808 Share on other sites More sharing options...
affordit Posted January 26, 2008 Author Share Posted January 26, 2008 I get a blank page when I run that code. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449816 Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 oops. replace find with which. <?php header("Content-type: text/plain"); echo "working path: ". get_cwd(); echo "php path: ". system("which php"); ?> had a brain burp. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449820 Share on other sites More sharing options...
affordit Posted January 26, 2008 Author Share Posted January 26, 2008 Still a blank page Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449823 Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 than u prolly have a windows based server. there is no which replacement. u can try looking thru phpinfo(); and see if u can find the php executable in there. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449830 Share on other sites More sharing options...
affordit Posted January 26, 2008 Author Share Posted January 26, 2008 Well I guess that solves that this is what I found: cron job A cron job is a command available to Unix system users that makes possible the automated execution of a task at predefined time intervals. One might set up a cron job to create hourly backups of a database, for example, or to send daily emails. Yahoo! currently does not support the use of cron jobs, but we hope to offer this feature with your plan in the future. Is there another way to run this script at regular intervals? Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-449843 Share on other sites More sharing options...
Aureole Posted January 27, 2008 Share Posted January 27, 2008 Get a decent host. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-450422 Share on other sites More sharing options...
laffin Posted January 27, 2008 Share Posted January 27, 2008 nope not at regular intervals. well methods from their server. u can try doing it remotely, just by having an application check the url. WinCron tied in with a batch file and WGet for windows shud do the trick or if u have php on yer pc, wincron and a php script. Quote Link to comment https://forums.phpfreaks.com/topic/87915-solved-cronjob-question/#findComment-450494 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.