CronJob
Posted: Fri May 23, 2014 18:19 UTC
I am having trouble getting my game to respond to the cronjob that calls the scheduler to update. Anyone have any insights into this?
Yup! This is the most common issue admins face when trying to get BNT setup.FoxMuldr wrote:I am having trouble getting my game to respond to the cronjob that calls the scheduler to update. Anyone have any insights into this?
Contact your hosting provider, and determine which command-line web fetching program they make
available to you, and where it is located. This is to help set up a background task that will be called
every X minutes.
You can set this to any interval you want, but 5 or 6 minutes are good standard values.
This task needs to call the web page scheduler.php passing the admin password to it, eg by accessing:
http://localhost/blacknova/scheduler.ph ... h=password
On UNIX and Linux, you can achieve this by using cron to call lynx to access
the pages at specified times. Lynx is just one of many programs you can use to access the page. It
may not be available on your server, and you will need to substitute a different program. Please check
your hosting provider documentation to determine which program is available.
A sample crontab follows:
*/6 * * * * /usr/bin/lynx --dump http://localhost/blacknova/scheduler.ph ... h=password > /dev/null
A few alternatives:
*/6 * * * * /usr/bin/GET http://localhost/blacknova/scheduler.ph ... h=password > /dev/null
*/6 * * * * /usr/bin/wget "http://localhost/blacknova/scheduler.ph ... h=password" > /dev/null
Please note that your hosting provider may have these programs at a different location than /usr/bin, requiring
you to change the location to match their documentation.
You may need to alter the URL to point to your exact domain name
and path. You will also need to change the password to your admin password.
To specify how fast-paced you want the game to be, you will need to
edit the file config.php and select how many minutes you want between
different events, eg turns or port regeneration.
What command line do you have in the cron tab?coolmates wrote:i am getting a cannot open input file and no such file or directory errors in cron, yet the file works fine when accessed in a browser.
tried server path and direct url in cron but without success.
Code: Select all
*/6 * * * * /usr/bin/lynx --dump http://www.cool-mates.com/bnt/scheduler.php?swordfish=ADMINPASS > /dev/null
Try dropping /dev/null from the cron line (it'll probably write a file to your home directory that you'll need to delete, so don't consider it fixed if it works)coolmates wrote:i am getting a cannot open input file and no such file or directory errors in cron, yet the file works fine when accessed in a browser.
tried server path and direct url in cron but without success.
Two error messages: Cannot open input file (Which input file?), and no such file or directory (Which file or directory).coolmates wrote:i am getting a cannot open input file and no such file or directory errors in cron, yet the file works fine when accessed in a browser.
tried server path and direct url in cron but without success.
Then you can put that into your cron, and you should have success.You can use any of the following in your crontab:
/usr/bin/curl
/usr/local/bin/wget
To help us improve, can you share what the working solution was for your server?coolmates wrote:thanks everyone for your kindness. the grabber worked like a charm, and as a result, so is the cronjob.