Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!princeton!newross!samadams!tr From: tr@samadams.princeton.edu (Tom Reingold) Newsgroups: comp.sys.pyramid Subject: Re: Mailing the output of a command run from cron Message-ID: <1991Apr15.215936.27605@newross.Princeton.EDU> Date: 15 Apr 91 21:59:36 GMT References: <1031@lucifer.UUCP> Sender: news@newross.Princeton.EDU (USENET News System) Organization: deferred Lines: 25 In article <1031@lucifer.UUCP> rst@lucifer.UUCP ( 233) writes: $ I am trying to get cron to mail me the standard output and standard error of $ regularly run commands. I have an entry that looks like this:- $ $ /usr/local/etc/crontab/evening |& mail -s "Evening cleanup" sysadmin $ $ I know the command is being executed, but the mail is never sent. Any ideas? If you use the cron in the att universe, you will get this automatically. Not only that, ordinary users can use cron in the att universe. They must (and the superuser ought to) use the "crontab" command for updating their personal crontab files. Now if you still want to do it your way, try command 2>&1 | mail -s "subject" sysadmin This is Bourne shell syntax. The "2>&1" means send output destined for file descriptor 2 to where output for fd 1 is going. -- Tom Reingold tr@samadams.princeton.edu OR ...!princeton!samadams!tr "Warning: Do not drive with Auto-Shade in place. Remove from windshield before starting ignition."