What is the purpose of 2 >&1 in crontab?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers What is the purpose of 2 >&1 in crontab?
# 1  
Old 11-14-2009
What is the purpose of 2 >&1 in crontab?

while we editing the cron at the end of the cron what is the purpose of giving 2 >&1
# 2  
Old 11-14-2009
piping stdout and stderr to whatever you apply after it.
# 3  
Old 11-15-2009
To redirect stderr (2) to whatever stdout (1) is pointing to (the two output streams get to be blended).

Last edited by Scrutinizer; 11-15-2009 at 03:03 AM.. Reason: Changed stdin to stdout (umpteenth time)
# 4  
Old 11-15-2009
Quote:
Originally Posted by Scrutinizer
To redirect stderr (2) to whatever stdin (1) is pointing to (the two output streams get to be blended).
A small correction, it is stdout ( 1 ) -- Not stdin.

So, To redirect stderr to stdout.
# 5  
Old 11-15-2009
This is just so funny. I keep saying stdin when i mean stdout.. Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab 2>&1 not emailing

I have a script that emails me when I run it manually, but the crontab I'm using must be 'silencing' the output? Here's what I have: */15 * * * * /usr/src/blah.sh > /dev/null 2>&1 I don't want it to email me every time it runs, just when I run the sendmail command inside the script if the... (13 Replies)
Discussion started by: unclecameron
13 Replies

2. UNIX for Dummies Questions & Answers

Permission on crontab & mysql

HI, I am using centos 6 and finding difficultly in doing 2 below things. 1. i have a user praveen i want to allow him to create cron job of his own. so i have added his user id in cron.allow but still it is not allowing him to edit(even if i have created praveen from root user) or create his... (4 Replies)
Discussion started by: praveenkumar198
4 Replies

3. 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

4. Solaris

[HELP] what does "2>&1" do in crontab?

Hi Experts, I would like to know, what does "2>&1" do in crontab? example: * * * * * /export/user/home/test.sh >> /export/user/home/logtest.log 2>&1 My colleague told me the commabd 2>&1 mean to prevent crontab sending an email (sendmail on /var/mail/root) when the script failed. So, if... (5 Replies)
Discussion started by: edydsuranta
5 Replies

5. UNIX for Dummies Questions & Answers

Purpose of <>

Hi, I have read from the book that , <> causes the file to be used as both input as well as output. Can anyone give me the scenario where <> will be useful? Thanks (10 Replies)
Discussion started by: pandeesh
10 Replies

6. Solaris

ifconfig primary & standby purpose

I have two ethernet interfaces nge0 and nge1. An IP assigned on nge0 is 10.10.10.1/24 and on nge1 is 20.20.20.1/24. I want to make nge0 as primary interface. My question here is, 1. Being nge0 as primary interface, if I ping to an IP 20.20.20.5, what will happen? 2. If the answer for the... (4 Replies)
Discussion started by: nthiruvenkatam
4 Replies

7. Fedora

Crontab & MAILTO

Hi there, I'm working with two servers, one with FEDORA 6 and the other one with FEDORA 7, and if I put these lines in crontab: MAILTO=MYADDRESS@mail.com */1 * * * * df -h everything works fine on FEDORA 7 , while it doesn't work on6?!?...and I find this message in the log file: MAIL... (2 Replies)
Discussion started by: Giordano Bruno
2 Replies

8. UNIX for Dummies Questions & Answers

crontab & var/spool/mai

Hi there, I'm using crontab to move some files every minute, but when crontab doesn't find these files it sends a message to the file "user_name" in the directory "var/spool/mail". Is it possible to "bypass" this problem? Thanks in advance, Giordano Bruno (1 Reply)
Discussion started by: Giordano Bruno
1 Replies

9. Shell Programming and Scripting

Purpose of 2>&1 in the command

Can any body kindly tell me what is the purpose of 2>&1 in the following commands. nohup ./append_import.sh 1 > import1.out 2>&1 < /dev/null & nohup ./append_import.sh 2 > import2.out 2>&1 < /dev/null & (1 Reply)
Discussion started by: mmunir
1 Replies

10. Solaris

ssh & crontab bug

Does any one knows a work around for the crontab bug when connecting using ssh to a Solaris 8 system? When you submit a crontab job through a ssh session, the job will not be executed, SunSolve has reported no fixing patches? (3 Replies)
Discussion started by: Negm
3 Replies
Login or Register to Ask a Question