homepage Welcome to WebmasterWorld Guest from 54.196.206.80
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Need some advice. How to - .pl script
Modern Merlin




msg:3708134
 2:41 pm on Jul 26, 2008 (gmt 0)

I am trying to setup a program in Flash using PHP and MySQL. When I came to a portion of it that needs to be automatically updated with or without the end user being logged on I was told I needed to use a cronjob.

Now to be honest I have never touched this is my life. I found the information about setting up a cronjob and now I need to setup a .pl script. Basically the this script would need to update the credits field in a table every 15 minutes based on the end users account field.

If someone could point me in the right direction as to where I might find something like this or how to write it, that would be much appreciated! Thanks!

MM

 

janharders




msg:3708144
 3:03 pm on Jul 26, 2008 (gmt 0)

sure. cronjobs are set up with
crontab -e -u username
where username is the user the cron should be executed under.
format is:
m h dom mon dow command
so, let's say you want to run your script every 30 minutes, just put in a line
0,30 * * * * /var/www/myscripts/update-credits.pl

as for the perl-script itself, you basically copy it to the server into the cgi-bin, make sure you used unix-linebreaks and chmod it to 755.
but you don't necessarily need a perl-script for a cronjob, you can also use a php-script and call it using lynx or wget. that'll invoke the script and you can do your updates.

perl_diver




msg:3708221
 5:08 pm on Jul 26, 2008 (gmt 0)

Where to find information about cronjobs? Do you really need to ask? google. ;)

Many hosts have a control that makes setting up cronjobs very simple.

perl_diver




msg:3708222
 5:12 pm on Jul 26, 2008 (gmt 0)


unix-linebreaks and chmod it to 755.

755 is for a CGI script. For a script run by a cronjob 700 (or lower) is advisable. It should also not be put in the public cgi-bin if possible. It should be in a folder that is not web accessible, above the root if at all possible. If that is not possible the cgi-bin should be the last resort but don't chmod to 755 unless the script will not run with lower permissions.

janharders




msg:3708231
 5:26 pm on Jul 26, 2008 (gmt 0)

ah, you're right, I was a little off and kept writing how to put a perl script on a website :)

Modern Merlin




msg:3708258
 6:55 pm on Jul 26, 2008 (gmt 0)

Thnks so much for the info! I have looked this up Janharders and now know which way to proceed (I hope) LOL

perl_diver, LOL wasnt asking about cronjobs. Re-read my post (second paragraph) ;)

perl_diver




msg:3708268
 7:27 pm on Jul 26, 2008 (gmt 0)

perl_diver, LOL wasnt asking about cronjobs. Re-read my post (second paragraph) ;)

oops.... my bad. Thanks for having a sense of humor. :)

Modern Merlin




msg:3708271
 7:42 pm on Jul 26, 2008 (gmt 0)

LOL no worries :) Life would be too boring without one ;)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved