Help - Search - Members - Calendar
Full Version: Cron Assistance Pls
Linuxhelp > Support > Technical Support
heemes
I have read:

http://www.linuxhelp.net/guides/cron/

and put together a cron job as follows:

0,10,20,30,40,50 * * * * /usr/bin/perl /var/www/cgi-bin/dada/plugins/dada_bridge.pl >> /dev/null 2>&1

I want perl to call the dada_bridge.pl file every 10 minutes to see what is sitting in the mailbox and send it to the dada list I have setup. I know everything is setup correctly on the server as I can run the dada_bridge.pl file manually and the listserv works well. Do I need to specify a user? Would root work? Does the dada.txt file (name of the cron listed above) need to be located somewhere in particular? Please advise. This is one of the last pieces of a month long ordeal setting up this listserv, would be nice to setup correctly.

Paul/Heemes
michaelk
Your job needs to be added to the cron table of a user. It can be root or any regular username as long as that regular user has read permissions in the directory where your perl script is located.

You can add the job using the crontab utility like the example in the guide.
crontab -e
heemes
So if I make the cron file read:

0,10,20,30,40,50 * * * * chlngday /usr/bin/perl /var/www/cgi-bin/dada/plugins/dada_bridge.pl >> /dev/null 2>&1

things should work? chlngday is the main user on this domain. I have used the commands:

crontab -r (to blow away the old file)

then uploaded the file to the html directory using SFTP, then

crontab dada.txt

on the command line, but alas, it doesn't work even then. Do I have the correct syntax or not? Please advise. I appreciate your help.

Paul/Heemes
michaelk
Does the output of the command crontab -l display your crontab entry correctly?

Can chlngday sucessfully run the cron job as is from the command line (minus the chlngday) ?
heemes
Will definitely get back on this on Monday; headed out of town for a long weekend. Appreciating everything so far!

Paul
heemes
> > Does the output of the command crontab -l display your crontab entry correctly?

Yes, I think so, here is what I got:

-bash-2.05b$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (dada.txt installed on Wed May 18 16:22:13 2005)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
0,10,20,30,40,50 * * * * chlngday /usr/bin/perl /var/www/cgi-bin/dada/plugins/dada_bridge.pl >> /dev/null 2>&1

> > Can chlngday sucessfully run the cron job as is from the command line (minus the chlngday) ?

How would I know this? Please refresh my memory.
Rathish
hi,

User crontabs
----------------
Stored as /var/spool/cron/<user>
View with: crontab -l
Edit with: crontab -e
Edit a specific users crontab(root only): crontab -u <user> ( For root !!! )

regards,
Rathish.K
heemes
Thanks, Rathish, for the feedback. But wasn't the question...

> > Can chlngday sucessfully run the cron job as is from the command line (minus the chlngday) ?

I don't know how to answer this question, unless I am missing something in what Rathish wrote. Please aide me in finding the answer.

Paul
heemes
Ok, I know the answer now, after putting on my thinking cap. Please excuse my ignorance in this.

I cannot run the plugin dada_bridge.pl. Here is the error message I get:

-bash-2.05b$ perl /var/www/cgi-bin/dada/plugins/dada_bridge.pl
Can't locate DADA/Config.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.0/mach /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.0/BSDPAN /usr/local/lib/perl5/5.8.0/mach /usr/local/lib/perl5/5.8.0 ../ ../DADA ../DADA/perllib . ./ ./DADA ./DADA/perllib /usr/lib/perl5/5.8.1/i386-linux-thread-multi /usr/lib/perl5/5.8.1 /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl) at /var/www/cgi-bin/dada/plugins/dada_bridge.pl line 23.
BEGIN failed--compilation aborted at /var/www/cgi-bin/dada/plugins/dada_bridge.pl line 23.

How do I modify the path (which seems to be the next step) so that this puppy will run?

Thanks for everything!

Paul/Heemes
heemes
Ok, solved the matter by learning how to write a shell script, then tying it to the cron job.

Thanks for everything that was contributed in the matter.

Paul
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.