Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Log rotation



On 3 Aug 2001, Seth Gordon wrote:

> Hmm, I'll have to look at that Logfile::Rotate module on Monday.  Thanks.
>
> If anyone has entirely too much free time over the weekend, they can
> explain to me why this script doesn't copy its input into the log file
> (as I expected), but just seems to write a stream of blank lines:
>
> #!/util/bin/bash
> trap 'cp log.recent log.`date -I` ' 1 # SIGHUP
> trap 'exit 0' 13 # SIGPIPE
> while [ read $line ]; do
>     echo "$line" >>log.recent
> done
>
#! /bin/sh

trap 'cp log.recent log.`date -I` ' 1 # SIGHUP
trap 'exit 0' 13 # SIGPIPE
while { read line; }; do                 # worked for me
# while ( read line ); do                # didn't work for me
    echo "$line" >> log.recent
done

YMMV

~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/  (___)  \|/ _,.-=~'`^`
                          Brian Medley         @~./'O o`\.~@
"Knowledge is Power" brian.medley at verizon.net /__( \___/ )__\  *PPPFFBT!*
  -- Francis Bacon                               `\__`U_/'
 _,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^`

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org