simple scripting question - directing output to a log file

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Eric Andresen
Date:  
Subject: simple scripting question - directing output to a log file
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 -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

--
--Eric Andresen