SMF Shop

SMFShop => Installation Problems => Topic started by: ProwlingTiger on April 30, 2007, 01:49:13 am

Title: cron job without cpanel?
Post by: ProwlingTiger on April 30, 2007, 01:49:13 am
Can someone help me configure the cron job without cpanel?
Title: Re: cron job without cpanel?
Post by: feeble on April 30, 2007, 07:30:47 am
what are you using instead of cpanel?
screen shot of your cron area?
your webhost?
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on April 30, 2007, 11:49:39 am
DreamHost....screenshot: http://img341.imageshack.us/img341/1411/cronjobag3.png (http://img341.imageshack.us/img341/1411/cronjobag3.png)
Title: Re: cron job without cpanel?
Post by: feeble on April 30, 2007, 12:26:14 pm
example of running a php in cron for dreamhost
/dh/cgi-system/php5.cgi /home/youruser/yourdomain.com/path-to-php5-script.php

just alter the /home/youruser/yourdomain.com/path-to-php5-script.php to the dointerest.php

and put it in command to run
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 02, 2007, 08:55:17 am
My user as in my shell ftp user?
Title: Re: cron job without cpanel?
Post by: feeble on May 03, 2007, 06:00:06 pm
My user as in my shell ftp user?

if you go into your smf forums admin->server settings

under sources directory
just use whats in there and add "\shop\dointerest.php"
for example your cron would now be

/dh/cgi-system/php5.cgi /home/youruser/yourdomain.com/Sources/shop/dointerest.php
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 04, 2007, 06:42:01 am
Okay so I dont replace the part where it says /youruser ? I just leave it alone? Or, do I use my forum user?
Title: Re: cron job without cpanel?
Post by: feeble on May 04, 2007, 07:15:56 am
Okay so I dont replace the part where it says /youruser ? I just leave it alone? Or, do I use my forum user?

just take a look, you should be able to tell
the source directory text area should start with /home... and so forth
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 04, 2007, 07:20:18 am
Eh I getcha!
Title: Re: cron job without cpanel?
Post by: Daniel15 on May 04, 2007, 09:12:54 pm
ProwlingTiger, did you solve this issue? Did the cron job end up working?
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 05, 2007, 06:54:26 am
Unfortunately, no....
Title: Re: cron job without cpanel?
Post by: Daniel15 on May 05, 2007, 11:02:15 am
Try contacting your host for support. Tell them you'd like to run Sources/shop/dointerest.php as a daily cronjob, and they should be able to help you :).
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 06, 2007, 12:49:10 am
Ok thank you!
Title: Re: cron job without cpanel?
Post by: p-chan on May 06, 2007, 04:51:56 pm
Hihi..i followed the instructions given, but it doesn't seem to work cos there's no increase in the money put in the bank.. =(
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 09, 2007, 06:23:26 am
Yeah...I dont know why it doesnt work. I put in a support ticket to my host. Maybe I should just call em up...
Title: Re: cron job without cpanel?
Post by: feeble on May 09, 2007, 08:06:31 am
Yeah...I dont know why it doesnt work. I put in a support ticket to my host. Maybe I should just call em up...

maybe this one might work instead
* * * * * /dh/cgi-system/php.cgi /home/youruser/yourdomain.com/path-to-php4-script.php

Quote from: p-chan
Hihi..i followed the instructions given, but it doesn't seem to work cos there's no increase in the money put in the bank.. =(

this is for dreamhost users only.
http://www.daniel15.com/forum/index.php/topic,193.0.html
for how to setup the cron on other hosts
Title: Re: cron job without cpanel?
Post by: p-chan on May 09, 2007, 11:40:11 am
Could it be that the code is wrong? Cos it seems a little different from the code provided by Daniel =)
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 09, 2007, 11:55:47 am
I contacted DreamHost. They told me something about not being able to run PHP scripts in that manner...or something.

Here's the script they gave me to try:
Code: [Select]
lynx -dump http://zephyrgaming.com/forums/Sources/shop/dointerest.php
Title: Re: cron job without cpanel?
Post by: p-chan on May 09, 2007, 12:03:15 pm
Thanks a lot! I shall try the code too =)
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 10, 2007, 03:31:54 am
I didnt get it to work. You?
Title: Re: cron job without cpanel?
Post by: p-chan on May 11, 2007, 10:17:17 am
I didnt get it to work. You?

Me too..it doesn't work.. T_____T
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 11, 2007, 11:00:29 am
Well I was then told to add something like /user/bin...but that didnt work either.
Title: Re: cron job without cpanel?
Post by: Daniel15 on May 12, 2007, 12:34:39 pm
I contacted DreamHost. They told me something about not being able to run PHP scripts in that manner...or something.

Here's the script they gave me to try:
Code: [Select]
lynx -dump http://zephyrgaming.com/forums/Sources/shop/dointerest.php
OK, If you need to run it like that, you need the script in the Bank interest without cron job? Read this! (http://www.daniel15.com/forum/index.php/topic,31.0.html) topic. Save that script with a random name (as detailed in that topic), test it out (by going to http://zephyrgaming.com/forums/whatever_it_is_called.php), and once it's confirmed as working, use the URL to it in the cron job.
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 12, 2007, 01:37:03 pm
Okay, I shall see if it works!
Title: Re: cron job without cpanel?
Post by: ProwlingTiger on May 13, 2007, 02:27:46 pm
Okay, Im about ready to just give this interest thing up.

Heres my cron job:
Code: [Select]
/usr/bin/lynx -dump=20
http://www/forums/filename.php

And the file code:
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.net/        |
\**********************************************/

//File: dointerest.php
//      The file to add interest to member's bank

//VERSION: 1.31 (Build 7)
//DATE: 10th December 2005

include("/home/.***/www/forums/SSI.php");

$interest_rate $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*
{$interest_rate})"__FILE____LINE__);

echo 
"Interest added at ".date("d/m/Y h:i:s A");
?>