The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 01-16-2008
ennstate ennstate is offline
Registered User
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Quote:
Originally Posted by moutaz1983 View Post
I know my question maybe eazy, but it realy cause a problem for me

I have a Perl script to run and get some output, I run this script using perl /moutaz/ciscolog/telnet.pl

I made another script as follow/moutaz/ciscolog/script)
#!/bin/bash
perl /moutaz/ciscolog/telnet.pl
cp /moutaz/ciscolog/ciscolog /moutaz/ciscolog/ciscolog-$(date'+%H-%M')-$RANDOM

Then made crontab as follow:
15 * * * * /moutaz/ciscolog/script

The question:
-when apply command from shell it worked fine.
- from crontab it doesn't, only the cp command work.

what is the problem?

Why dont you try redirecting the cron output to some log file
Code:
 15 * * * * /moutaz/ciscolog/script >> /tmp/cron.log 2>&1
If in the perl script ( /moutaz/ciscolog/telnet.pl ) you may have used the perl instead of full path to perl,try that too

Thanks
Nagarajan G
Reply With Quote