Author Topic: Help: Teach me how to setup my cron job  (Read 4289 times)

Offline edwardsiow

Help: Teach me how to setup my cron job
« on: April 03, 2007, 04:06:44 am »
attached here is my cron job setting screen from my direct admin's control panel...all my forum files inside public_html...

anyone please teach me how to setup to make the interest of bank work fine?

please....

thanks for your kindness....
« Last Edit: April 03, 2007, 04:09:50 am by edwardsiow »

Offline feeble

Re: Help: Teach me how to setup my cron job
« Reply #1 on: April 03, 2007, 10:34:58 am »
hmm, not really really sure if this will work.

is there any way for your to get a more advanced interface?
it possibly you could just copy and paste it and it should work, but i cant to sure.

anyways it should look something like this in your command box
/usr/bin/php -q /home/mortgago/public_html/Sources/shop/dointerest.php

just address the dir address accordingly to where you have smf installed.

also put a 0 in minute and a 0 in hour AFTER you have got it working. you can test it by leaving in the * so it will run every minute. if you bank amount goes up, then you know its working.

Offline Daniel15

Re: Help: Teach me how to setup my cron job
« Reply #2 on: April 03, 2007, 04:41:39 pm »
What feeble has said should work :). If it doesn't work, then try this command instead:
/usr/bin/php -q /home/mortgago/domains/[your domain]/public_html/Sources/shop/dointerest.php

If that doesn't work, I'll take a look at DirectAdmin later (FriHost.com uses DirectAdmin), and see how to get it working.

Offline edwardsiow

Re: Help: Teach me how to setup my cron job
« Reply #3 on: April 03, 2007, 09:49:30 pm »
thanks...i will try later....and report back as soon as possible...

nice to meet you all

Offline edwardsiow

Re: Help: Teach me how to setup my cron job
« Reply #4 on: April 03, 2007, 10:37:33 pm »
report back...

error occured:

/bin/sh: /usr/bin/php: No such file or directory

Offline feeble

Re: Help: Teach me how to setup my cron job
« Reply #5 on: April 04, 2007, 05:58:07 am »
try just
/home/mortgago/domains/[your domain]/public_html/Sources/shop/dointerest.php

Offline edwardsiow

Re: Help: Teach me how to setup my cron job
« Reply #6 on: April 04, 2007, 10:01:02 pm »
errors:

/home/mortgago/domains/mortgago.com/public_html/Sources/shop/dointerest.php: line 1:
?php
: No such file or directory
/home/mortgago/domains/mortgago.com/public_html/Sources/shop/dointerest.php: line 2:
/**********************************************
: No such file or directory
/home/mortgago/domains/mortgago.com/public_html/Sources/shop/dointerest.php: line 3:
syntax error near unexpected token `|'
/home/mortgago/domains/mortgago.com/public_html/Sources/shop/dointerest.php: line 3:
`| SMFSHOP (Shop MOD for Simple Machines Forum) |
'

Offline edwardsiow

Re: Help: Teach me how to setup my cron job
« Reply #7 on: April 05, 2007, 09:29:53 pm »
can somebody help me? if this problem can't solve, i can't start to use this mod...

please...i love this mod.....

Offline feeble

Re: Help: Teach me how to setup my cron job
« Reply #8 on: April 07, 2007, 07:03:42 am »
are you sure you have the right dir address?

can you please let me know whats in your SMF directory box under server settings in SMF admin area.

you seem to have joomla installed?

Offline Daniel15

Re: Help: Teach me how to setup my cron job
« Reply #9 on: April 07, 2007, 07:25:56 pm »
OK, this should definitely work:
/usr/local/bin/php -q /home/mortgago/domains/mortgago.com/public_html/Sources/shop/dointerest.php

I forgot that most DirectAdmin installations have php in /usr/local/bin rather than /usr/bin.

Offline feeble

Re: Help: Teach me how to setup my cron job
« Reply #10 on: April 07, 2007, 10:01:19 pm »
odd, but if it works

Offline Steev

Re: Help: Teach me how to setup my cron job
« Reply #11 on: April 13, 2007, 11:28:42 pm »
Yeah, I've been having issues with Cron on my server as well (playing with my stock)...I had to use /usr/local/bin/php for my php command.  I also had to change the include("../../SSI.php") line to have the full path to the SSI.php, as the include-path apparently treated the . directory as the /usr/local/bin, not as the directory of the php file I was running.

So I'd suggest the command be the following:
/usr/local/bin/php -q /home/mortgago/domains/[your domain]/public_html/Sources/shop/dointerest.php.


Mind, the part after the -q should be the actual path to your dointerest.php.  I'm assuming that the path above is correct, based on the errors you were showing.

Also, based on those, double check the dointerest.php file...that first error looks like you might be missing a '<' at the very first character of the file, somehow.


EDIT: Missed that daniel15 suggested the exact same thing...oops.  Sorry for the duplicate info.

Offline Daniel15

Re: Help: Teach me how to setup my cron job
« Reply #12 on: April 14, 2007, 01:35:00 pm »
Quote
  I also had to change the include("../../SSI.php") line to have the full path to the SSI.php, as the include-path apparently treated the . directory as the /usr/local/bin, not as the directory of the php file I was running.
I thought I fixed that, but I guess it's yet another thing I didn't get around to :P. Changing the include line to include($boarddir '/SSI.php'); should make it work in all circumstances, as this will make it use the $boarddir setting from Settings.php :)

Quote
Also, based on those, double check the dointerest.php file...that first error looks like you might be missing a '<' at the very first character of the file, somehow
The errors meant that it was trying to execute the PHP script as a shell script (shell scripts have a special meaning for "<" and ">" characters - They're used to pipe data to/from files). That's my fault; I should have added a shebang line to the top of the dointerest.php file.