Click here to get back home

cron manipulation and perl-cgi

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
cron manipulation and perl-cgi siddhartha mulpuru 09-20-2004
Get Chitika Premium
Posted by siddhartha mulpuru on September 20, 2004, 5:02 pm
Please log in for more thread options
Hi,

I am trying to develop a webpage with login,password and Unix box name
as input fields which will post to a perl script that would do the
following in CRON:
- Allow you to access and LOGIN to specific UNIX boxes
- Display the entries
- Allow Editing of an entry
- Allow searching for a specific entry
- The returned page for each entry must display the page in "laymen's"
english, not cryptically as found in CRON
(In other words a conversion must take place to and from the format
in CRON)
- Upon entering the data it should submit convert the entry from
laymens' display, send it to the system, and
issue the "CRONTAB Filename" command to upload it for that specific
USERID/PASSWORD.

I need to know ideas on how i can go about implementing this. Any
Modules that exist which implement some or all of the tasks or just
some ideas how this can be done ?

Please advise and i appreciate your time a lot

Thanks
Sid


Posted by Bill Karwin on September 20, 2004, 5:45 pm
Please log in for more thread options
siddhartha mulpuru wrote:

> Hi,
>
> I am trying to develop a webpage with login,password and Unix box name
> as input fields which will post to a perl script that would do the
> following in CRON:
> - Allow you to access and LOGIN to specific UNIX boxes

I'd advise against sending passwords for your UNIX boxes as http
parameters. I recommend establishing a "trusted host" setup for the
server & user ID of your CGI program, so that you can execute commands
on the UNIX hosts _only_ from that host/user combination.

Another possibility is to make the CGI so that it can only edit the
crontab on the local machine, but it can take requests as http parameters.

Be sure to familiarize yourself with checking for taintedness of
parameters in Perl. You should validate all parameters of the CGI
before using them for something as potentially harmful as editing the
crontab.

> - Display the entries
> - Allow Editing of an entry
> - Allow searching for a specific entry
> - The returned page for each entry must display the page in "laymen's"
> english, not cryptically as found in CRON

This you'll probably have to do yourself. What constitutes lay person's
language depends on your target audience. Also, it might not be the
best choice to convert to a single string. You could convert the
schedule to a set of HTML form entries, for instance checkboxes or a
multi-select list for days of the week, and months, and a text box
accepting integers for day of the month, and a text box for each of
hours and minutes. The output of your form's input elements would have
certain entries SELECTED or CHECKED depending on the cron schedule.

> (In other words a conversion must take place to and from the format
> in CRON)
> - Upon entering the data it should submit convert the entry from
> laymens' display, send it to the system, and

Again, it depends on your definition of lay person's representation. Or
you can take multiple inputs from the HTML form and create the cron
schedule string without too much difficulty.

> issue the "CRONTAB Filename" command to upload it for that specific
> USERID/PASSWORD.
>
> I need to know ideas on how i can go about implementing this. Any
> Modules that exist which implement some or all of the tasks or just
> some ideas how this can be done ?

There are quite a few Perl modules that do various things related to
Cron. Search at http://search.cpan.org/. For instance,
DateTime::Event::Cron looks promising.

Bill K.


Similar ThreadsPosted
perl date manipulation October 21, 2004, 5:02 pm
MS SQL server and SQL DATETIME manipulation in perl April 29, 2005, 2:23 am
Windows Registry manipulation using Unix April 29, 2005, 11:46 am
Excel file manipulation in HPUX system October 14, 2004, 8:13 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap