Sponsored Content
Top Forums Shell Programming and Scripting Script fails to run properly when run from CRONTAB Post 302882056 by rusman on Saturday 4th of January 2014 12:30:02 AM
Old 01-04-2014
Wrench Script fails to run properly when run from CRONTAB

Hello all,

I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly.

My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but not from cron. Through troubleshooting I have found that this line
#Execute the 'report' portion of nbdeployutil and send output to a file.
/bin/echo `$mail_report` > /tmp/nbdeployutil_temp_rpt.out


isn't actually executing the $mail_report variable (which is just a string of text) and updating a temp file, so the rest of the script doesn't work. Any thoughts on why this isn't working through cron? I've checked the environment and it seems ok. I even tried to have cron run it with bash -c "scriptname.sh" and behavior did not change.

This is on a solaris 10 system, but I am also running the same script on SuSe 11 and it is behaving in exactly the same way.

Thanks for the help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

recurring run of sh script in crontab

Hello gurus. I have a problem: my crontab -e is looks like this: ORACLE_SID=bla-bla * 21 * * * (sqlplus hotback/hotback @/oracle/backups/bla-bla/scripts/hotback/daily_hotback.sql) 0 19 * * * /oracle/backups/dev10g/scripts/exports/daily_exports.sh 0 1 * * *... (4 Replies)
Discussion started by: MarGur
4 Replies

2. Shell Programming and Scripting

Running script that sends an html formatted email fails when its run as cronjob

Hi Im very new at working with unix and this problem I simply can not understand. I know there are a lot of threads about problems with shell scripts behaving differently when run from a terminal and from a cronjob. I have tried everything(almost) but I still havent cracked this problem. Im... (15 Replies)
Discussion started by: Nightowl
15 Replies

3. Shell Programming and Scripting

How do i run a shell script without crontab.

Hi Folks, Could you please suggest me how to run a shell script on a solaris env without using crontab. I am actually trying to write a shell script which will grep "WORD" in the logfile andd sends a email.Thanks in advance. Thanks Sandeep. (3 Replies)
Discussion started by: sandeep anand
3 Replies

4. Shell Programming and Scripting

Script not running properly when run from Crontab

Hi I am a novice Linux/Perl user and am struggling to overcome what I am sure is a simple problem. I am using a perl program to create a shell script daily containing between 10 and 30 "at -f" commands for the same day. Then I change the file attributes to allow the file to be executed. When... (2 Replies)
Discussion started by: simoncjones
2 Replies

5. Shell Programming and Scripting

crontab fails to run script

OS is Ubuntu 8.04.3. When I run the command: /usr/bin/syslogMailer < /etc/syslog.pipes/criticalMessagesFrom a bash shell it works and i receive an email as per the script however when run from crontab it does not work. Can anyone explain why and how to fix it? /usr/bin/syslogMailer... (4 Replies)
Discussion started by: jelloir
4 Replies

6. Shell Programming and Scripting

run script through crontab using ksh

hi i have a script called test.sh. the content is ls >> crontest.txt. if i run manually it's giving output.but if i scheduled in crontab it's not giving output. crontab entry: 02 * * * * /sms5/SMSHOME/eds_sh/test.sh >> /sms5/SMSHOME/eds_sh/testfile/logfile 2>&1 I am using ksh.is there... (2 Replies)
Discussion started by: muraliinfy04
2 Replies

7. Shell Programming and Scripting

Script fails with ORA-20000 when run with su

Hi, I have a ksh script that runs as root ans issues several commands as a user differente from root as 'su <user> -c "command" ' . It works fine except for one step where the command executes sql statements. That command fails with ORA-20000. Now the strangest thing, if I place a read command... (5 Replies)
Discussion started by: naf
5 Replies

8. Shell Programming and Scripting

Script does not run properly

Hello everybody Im learning bash scrpting language and im making a script that read a file line by line and it does a comparison if in a line start with a letter or number and it will delete every ones that start with a letter. But im getting some errors First of all, this is the script's... (5 Replies)
Discussion started by: alienrunes
5 Replies

9. Shell Programming and Scripting

Bash script fails when run as file

The following bash script fails with error message: "./phpquery_KNBB_html_reader.sh: line 65: syntax error near unexpected token `done'" when do ./<scriptname> in the shell. However when I copy-paste the entire contents of the file directly into a shell environment it runs ok returning the intended... (2 Replies)
Discussion started by: BurritoSolution
2 Replies

10. Shell Programming and Scripting

Replace string works on command-line but fails when run from shell script

I wish to replace "\\n" with a single white space. The below does the job on command-line: $ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g'; /fin/app/scripts /fin/app/01/sql However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 Replies
uudemon(4)						     Kernel Interfaces Manual							uudemon(4)

NAME
uudemon.admin, uudemon.cleanu, uudemon.hour, uudemon.poll - Administrative shell scripts for polling remote systems, cleaning up spool directories, reporting status to the system administrator, and routine invocations of the uuxqt and uusched daemons SYNOPSIS
These shell scripts reside in the following directory: /usr/lib/uucp DESCRIPTION
All the scripts can be run from the command line or can be run automatically by the cron daemon. To automatically run the scripts, remove the comment character (#) from the beginning of the relevant line in the /var/spool/cron/crontabs/uucp file. This script reports status to the system administrator. It issues the uustat command to find out the status of uucp jobs. It mails the results to the uucp login ID. The script may be modified to send mail to any login ID such as the uucp administrative login ID (uucpa) or root. This script cleans up the /var/spool/uucp and /var/spool/uucppublic directories by running the uucleanup command. The uucleanup com- mand is run with the following parameters: -C7, -D7, X2, -o2, -W1. This script runs the uusched and uuxqt daemons in the background. This script polls the systems listed in the /usr/lib/uucp/Poll file. The uudemon.poll script should be scheduled before the uudemon.hour script. This allows uudemon.poll to create any command files before cron runs the uudemon.hour script. FILES
Contains the uudemon.admin, uudemon.cleanu, uudemon.hour and uudemon.poll files. Contains the uucp file. RELATED INFORMATION
Commands: cron(8), uucleanup(8), uusched(8), uuxqt(1) Files: /usr/lib/uucp delim off uudemon(4)
All times are GMT -4. The time now is 08:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy