Sponsored Content
Full Discussion: A Cron Issue
Top Forums Shell Programming and Scripting A Cron Issue Post 302393169 by mac4rfree on Monday 8th of February 2010 05:14:34 AM
Old 02-08-2010
A Cron Issue

Hi Guys.,,

This thing is driving me crazy..

I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually.

But when i am running it from crontab, the script is not sending mail to me but to my id(login id) in the box. In that log, am able to see that the mailx command ran still i am not able to get any mails for it..

Can you guys tell me where i am overlooking.

I am pasting the log i got from my mailbox (unix).

Code:
Your "cron" job executed on fcrd02 on Mon Feb  8 04:25:00 EST 2010
/clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh > /clocal/fastcar/user/fcfmetl/crontlog/trigger_execTVGen.log


produced the following output:

+ msg=SCRIPT: /clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh\nexecTVGen Trigger: No data to be processed Will wait for 5 minutes\nDATE: Mon Feb  8 04:25:02 EST 2010
+ sub=execTVGen Trigger will wait for 5 mins
+ body=
+ var=2
+ echo No of variables: 2
+ [[ 2 -eq 3 ]]
+ hostname
+ date
+ mail -s /clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh - execTVGen Trigger will wait for 5 mins um26@xxx.com
+ echo SCRIPT: /clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh\nexecTVGen Trigger: No data to be processed Will wait for 5 minutes\nDATE: Mon Feb  8 04:25:02 EST 2010\n\nServer : fcrd02\nSent on : Mon Feb  8 04:25:02 EST 2010\nScript : Email


*****************************************************************
        cron: The previous message is the standard output
        and standard error of one of the cron commands.



---------- Post updated at 03:44 PM ---------- Previous update was at 03:02 PM ----------

Guys.. the issue was not with cron command.. but with the mail command

Code:
 echo "$msg\n\nServer : `hostname`\nSent on : `date`\nScript : Email" | mail -s "$0 - $sub" "$NotifyList"

The "-" was causing a problem..i replaced it with :

Still i am just wondering how the script ran fine when i ran it manually??
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

cron issue

user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly. . /user/.profile # sorce the users profile for file in `ls`; do mv $file $file.`date +%Y%m%d%H%M%S``microsec` done microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies

2. Solaris

Cron issue

When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9. export EDITOR="vi" is set in my profile I am using BASH $ sudo crontab -l Password: #ident "@(#)root ... (5 Replies)
Discussion started by: kingdbag
5 Replies

3. Red Hat

cron issue

Hello, Having and issue with a job scheduled in cron. The script: #!/bin/bash 2 3 # Example shell script which can be added to roots cron job to check the 4 # Embedded Satellite disk space usage. If any table is over 90% usage, send 5 # a notice to the default email address... (2 Replies)
Discussion started by: mgb
2 Replies

4. Red Hat

Cron Issue

Hey all! I'm working on setting up a script to run with cron. I have thus far been unable to get it to successfully complete. I'm hoping you gurus can lend me a hand. This is my crontab, the transfer script works fine the backup will not. The backup however does work when I execute it from the... (11 Replies)
Discussion started by: spiffyville
11 Replies

5. Shell Programming and Scripting

Issue with Cron

Hi Gurus, I need to run a script every saturday at 7:05 PM. Below command is working in x86_64. 05 19 * * 6 /apps/informatica/scripts/inf_rest.ksh However when I tried in HP-UX it is giving the below error. crontab: error on previous line; unexpected character found in line. Please... (4 Replies)
Discussion started by: svajhala
4 Replies

6. UNIX for Advanced & Expert Users

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

7. UNIX for Dummies Questions & Answers

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

8. Ubuntu

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (3 Replies)
Discussion started by: manjunath.nm89
3 Replies

9. Solaris

CRON Issue

Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies

10. Shell Programming and Scripting

Cron issue

i have written a script to sftp yesterday's logs from another server as below: cd /export/home/abc/xyz/tt d=`gdate -d'yesterday' +%Y%m%d` sftp abc@XXX.XX.XX.XX<<EOF cd /yyy/logs/archive mget abc.log.$d* EOF cd /export/home/abc/xyz/scripts nohup ./ss.sh PROD & it is working fine... (2 Replies)
Discussion started by: ssk250
2 Replies
ATF-SH(1)						    BSD General Commands Manual 						 ATF-SH(1)

NAME
atf-sh [-s shell] -- interpreter for shell-based test programs SYNOPSIS
atf-sh script DESCRIPTION
atf-sh is an interpreter that runs the test program given in script after loading the atf-sh(3) library. atf-sh is not a real interpreter though: it is just a wrapper around the system-wide shell defined by ATF_SHELL. atf-sh executes the inter- preter, loads the atf-sh(3) library and then runs the script. You must consider atf-sh to be a POSIX shell by default and thus should not use any non-standard extensions. The following options are available: -s shell Specifies the shell to use instead of the value provided by ATF_SHELL. ENVIRONMENT
ATF_LIBEXECDIR Overrides the builtin directory where atf-sh is located. Should not be overridden other than for testing purposes. ATF_PKGDATADIR Overrides the builtin directory where libatf-sh.subr is located. Should not be overridden other than for testing purposes. ATF_SHELL Path to the system shell to be used in the generated scripts. Scripts must not rely on this variable being set to select a specific interpreter. EXAMPLES
Scripts using atf-sh(3) should start with: #! /usr/bin/env atf-sh Alternatively, if you want to explicitly choose a shell interpreter, you cannot rely on env(1) to find atf-sh. Instead, you have to hardcode the path to atf-sh in the script and then use the -s option afterwards as a single parameter: #! /path/to/bin/atf-sh -s/bin/bash ENVIRONMENT
ATF_SHELL Path to the system shell to be used in the generated scripts. SEE ALSO
atf-sh(3) BSD
September 27, 2014 BSD
All times are GMT -4. The time now is 05:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy