![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| crontab-nmon not working | fara_aris | AIX | 5 | 06-03-2008 02:08 AM |
| Pro*C Update not working from Crontab | alhallay | UNIX for Advanced & Expert Users | 2 | 09-15-2007 09:25 PM |
| crontab NOT working | baanprog | UNIX for Advanced & Expert Users | 2 | 09-26-2006 09:11 AM |
| crontab command not working | digant | UNIX for Advanced & Expert Users | 8 | 01-04-2004 05:46 PM |
| crontab not working right | kymberm | UNIX for Dummies Questions & Answers | 3 | 07-09-2003 01:21 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
cron/crontab not working
Hello All!
I'm having problems with cron. First cron is running as a process when i send the top command and I am logged in as root. I type crontab -e to edit/create my cron job. What I'm trying to do is run a perl script on my server (the script does work, i know because I type perl script.pl and it runs). Here is an example of my crontab: 20 * * * * perl /var/dir/script.pl | cat update.email >> mail ed@ed.com So if I understand cron right, every 20 minutes my scripts.pl will be executed by perl then an email will be sent to my email address with the contents of the update.email file. This is not happening though. The script is not executing and I am not getting emails to confirm it. Any suggestions are welcome. thanks! Ed
__________________
g_M_e |
| Forum Sponsor | ||
|
|
|
||||
|
Hi Ed,
A few quick pointers should get you going in the right direction. First, your cron job will run at 20 after the hour and only once per hour. If you want to run it every 20 minutes you should have a cron entry like this: 0,20,40 * * * * perl blah blah blah This will run at the top of the hour, 20 after, and 40 after. Second, your script is running but is directing the output of cat to a file called 'mail'. Try running 'perl /var/dir/script.pl | cat update.email >> mail ed@ed.com' from command line. I don't think you will get the results you want. I think a better approach would be to put the 'cat' and 'mail' commands in your perl script or write a ksh/csh/sh/bash/etc wrapper script that first runs the script.pl and then 'mail ed@ed.com<<update.email'. Notice the mail syntax change. This will e-mail you the file where your previous command was basically creating a copy of upate.email called mail. |
| Thread Tools | |
| Display Modes | |
|
|