crontab output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting crontab output
# 1  
Old 11-27-2003
crontab output

we have a number of scripts written in either perl, sybperl or a combination of unix sh and sql, which are cronned to run at different times. The crontab includes a redirect to an output file, however, the output file is being created but nothing is being written. The output is being written and emailed via the crontab, which isn't what I want.

The cron env is /bin/csh, and most of the entries in the crontab need to be inside a /bin/csh -c " " to run:

eg 0 5 * * 1-5 /bin/csh -c "/path here > /output path here"

Any suggestions on how I can get the output to actually be written to the specified output file?

Many thanks.
jodie
# 2  
Old 11-28-2003
Hi,


Use:
eg 0 5 * * 1-5 /bin/csh -c "/path here > /output path here 2> &1

Last edited by jsilva; 11-28-2003 at 06:07 AM..
# 3  
Old 11-30-2003
thanks for this - we actually do have some crontab jobs with this output and some without - it doesn't seem to make any difference, the output still seems to go to the cron...
jodie
# 4  
Old 12-01-2003
I think redirection is different in csh, more like...

0 5 * * 1-5 /bin/csh -c /path here >& /output path here

...another reason why I don't use it!
# 5  
Old 12-01-2003
cool, thanks - this seems to work. Smilie
jodie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to redirect 'crontab' output to a variable?

I'm trying to redirect the output of crontab to a variable named "crontab_status" as below: crontab_status=$(crontab -l) executing the script is not redirecting to the variable. Please help! (6 Replies)
Discussion started by: mjavalkar
6 Replies

2. Solaris

Solaris Crontab & TOP output

Hello Guru's I'm trying to take the output of solaris top command and output to a txt file every few minutes. The issue that I'm experiencing is that I can run the following: #!/bin/bash # logfile="/usr/mvf/morris/top.log" # echo... (2 Replies)
Discussion started by: littlemorris
2 Replies

3. UNIX for Dummies Questions & Answers

How to change crontab output from console to email?

Hi, We are currently running AIX 6.1 TL4. There are around 30 ksh scripts that are ran from crontab which if an error occurs or a problem with an ftp unix sends the out of the ksh script which goest to our console via the local user hci which is viewed by the mail command. I've tired adding... (2 Replies)
Discussion started by: hgjdv
2 Replies

4. Shell Programming and Scripting

Crontab Job Output File

I am a newbie to Unix. My default root user umask is set to 077 and I have the following crontab job to redirect al the backup output to the logfile of /backup/backup.xxxxx 00 10 * * 0 /usr/local/bin/backup.sh > /backup/backup.`date +\%Y\%m\%d` 2>&1 Since root default umask is 077, the... (2 Replies)
Discussion started by: famasutika
2 Replies

5. Linux

crontab output

Hi, i put in crontab */5 * * * * echo "Hello" where i can see the output of this ? because in terminal i can't see any output if i put like this , i see the output in file hello.txt */5 * * * * echo "Hello" >> hello.txt Thanks in advance (1 Reply)
Discussion started by: prpkrk
1 Replies

6. Shell Programming and Scripting

Different output when run from crontab

Hi, I have a script which checks to see if an app is running and will restart it if it is not. For some reason when I run it from the crontab it always says it is not running. The script is as follows: - #!/bin/sh # # The following script will look for the PID of SickBeard and output... (15 Replies)
Discussion started by: simpic
15 Replies

7. Shell Programming and Scripting

Issue with redirecting output from crontab

Hello All, I've scheduled one simple command to be run from crontab, but the command is failing to append the output to a file. Any issue in my syntax ? This rah cmd is working fine from command center. 19 09 * * * rah "df -m" | awk '{if (NF > 1) if ($5 ~ /NODE/) {print $0;}}' >> db.out 2>&1... (1 Reply)
Discussion started by: NARESH1302
1 Replies

8. UNIX for Dummies Questions & Answers

Issue with crontab output

Hi , I have this crontab job which is not able to write a db2 command output to a file . The output file comes out to be of file zero and it sends me wrong alerts . cat indoubt_transaction.shl #!/bin/ksh... (1 Reply)
Discussion started by: capri_drm
1 Replies

9. UNIX for Dummies Questions & Answers

Crontab to output sar stopped automatically

We have created a crontab to output the sar result as below: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/lib/sa/sa1 However, the sar output was being truncated off, meaning, rather than capturing the output in an interval of 5 minutes, it stopped at certain hour and will not be resumed. ... (3 Replies)
Discussion started by: penangite
3 Replies

10. Shell Programming and Scripting

output from crontab run

Hi, I am trying to schedule a job in linux through the crontab command.My script actually does some text processing and echoes some output.My cron scheduler is working fine,but the output messages(echoes from script) is mailed to my mail account(in unix -/var/local/mail).Is it not possible... (0 Replies)
Discussion started by: DILEEP410
0 Replies
Login or Register to Ask a Question