Gossamer Forum
Quote Reply
Cron
This maybe a stupid question.. but then again , there is no such thing as a stupid question..

I was wondering if there was a way you can set a cron job with some perl code or some sort of mod. I have never had the chance to use Cron but hope to try it out to see if i can make a certian program. Anyway.. THANX in advance !

ZomZangZoomWink
Quote Reply
Re: [ZimZangZoom] Cron In reply to
Yup, its definatly possible. I actually was working on a script to do this, but got a bit side tracked with some other stuff. I'm hoping to be able to get back on track with it again in about a month.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Cron In reply to
Good stuff... But how is kinda my question....
Quote Reply
Re: [ZimZangZoom] Cron In reply to
The way I was doing it was to put the contents of 'crontab -l' into a string. Then split it up into single processes, and then split each of them up into the date/time etc. That let me create a HTML interface of what was already there. Then when someone wanted to add a new cron job, I would just grab the contents of the old file, add the new one, save it to a file, and then run a 'crontab mysavedfile.txt' command vias the `` tool in Perl.

Have a look at what I got here if you want;
http://www.ace-installer.com/cron/setcron.cgi (like I said, I got stopped half way, so most of it wont work, only really the frontpage).

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Cron In reply to
I am still stuck. Does anyone have any CODE examples I can see to learn how to tell my program to start a cron job or add to it?
Quote Reply
Re: [ZimZangZoom] Cron In reply to
Create Cron Jon;
crontab yourfilewithcrontabsin.txt

List CrontTabs
crontab -l

Obviously you need to learn how to get this data, but the main way of doing it is by using ``'s. E.g;

Code:
$var = `crontab -l`;

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Cron In reply to
....which will list all crons if you are root.

....and will only list your usernames crons if not.