simple scripting question - directing output to a log file

Eric Andresen plug-discuss@lists.plug.phoenix.az.us
28 Jan 2003 09:22:06 -0700


two ways: Append a 2>&1 1>logfile to the cronjob or use something like
'tee' or 'script' to log to a file.

On Tue, 2003-01-28 at 09:08, Scott H wrote:
> I have a little script that I want to use to
> mirror one partition to another, using mirrordir
> via a cron job.  I want the script to log it's
> output to a log file, like .../messages, or a
> custom one, like .../mirrordir.log.  How do I get
> it to do this, either in the script itself, or by
> telling cron to put output there?  Here sort of
> what the script looks like:
> 
> #!/bin/sh
> date
> echo "Mirrordir says:"
> mirrordir --exclude /mnt / /mnt/hda4
> date
> echo "Done."
> 
> TIAFAH!
> 
> Scott
> 
> 
> .
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
-- 
--Eric Andresen
  ndiin@asu.edu