Cron support

oiwio

New Member
Messages
214
Reaction score
0
Points
0
I tried making my first cron today and Im getting a "/bin/sh: /home/oiwio/public_html/hpup: Permission denied"
Im not very skilled with it yet so can someone help me out?

my cron run command is "/home/oiwio/public_html/hpup"

and the shell file is here
Code:
#!/bin/sh
hpup2.pl

and heres the perl file
Code:
[I]#!/usr/bin/perl[/I]


[I]# PERL MODULE WE WILL BE USING[/I]
[B]use[/B] Mysql;


[I]# MySQL CONFIG VARIABLES[/I]
$host = "fmammorpg";
$database = "oiwio_oiwio";
$tablename = "users";
$user = "oiwio_oiwio";
$pw = "PW";


[I]# PERL MYSQL CONNECT[/I]
$[B]connect[/B] = Mysql->[B]connect[/B][U]([/U]$host, $database, $user, $pw[U])[/U];


$[B]connect[/B]->selectdb[U]([/U]$database[U])[/U];


$hp = 'hp + 1';


$myquery = "INSERT INTO
$tablename [U]([/U]username, hp[U])[/U]
VALUES [U]([/U]*, $hp[U])[/U]";


$execute = $[B]connect[/B]->query[U]([/U]$myquery[U])[/U];

What I want this to do is go into the database and in the table oiwio_oiwio, +1 to all the users hp

I am not sure what is wrong since I have no experiance with crons yet
so if someone could help me that would be great.
 

adrenlinerush

New Member
Messages
379
Reaction score
1
Points
0
try adding the file extenstion to the run command and checking the chmod permissions on the file
 

oiwio

New Member
Messages
214
Reaction score
0
Points
0
ok, now Im getting a "/home/oiwio/public_html/hpup.sh: line 2: hpup2.pl: command not found"
 

oiwio

New Member
Messages
214
Reaction score
0
Points
0
now Im getting a:
Can't locate Mysql.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl .) at /home/oiwio/public_html/hpup2.pl line 4.
BEGIN failed--compilation aborted at /home/oiwio/public_html/hpup2.pl line 4.
 

pheonixco.

New Member
Messages
3
Reaction score
0
Points
0
looking at your coding i think it would stuff up because of this
$hp = 'hp + 1';
if the health value on your game is $hp then its going to stuff up
try something like this
SET VALUES ($hp) = $hp+1
as for your file not found check your account details and make sure its in a private folder and that the account details are right
PW should be your username on databases password (just in case it is set as PW)
Edit:
looking again another thing
i dont think you need to connect to the database
 
Last edited:

oiwio

New Member
Messages
214
Reaction score
0
Points
0
I used the $hp = '$hp + 1' because I didnt know exactly how to do that so I changed that.

Another thing I dont understand is how its having a problem find the "use Mysql;" command. Im not sure how I would be able to fix that.

And also, why wouldnt I need to connect to the database?
 
Top