Listmates,

    I'm suffering from a cranal-rectal inversion and just can't seem to
figure out how to redirect output to BOTH a log file and to stdout at
the same time. I just want the output to appear on the screen and in the
log file. I did rtfm, but the stdout 2 stderr, then vice versa, and then
both to file examples didn't help. So, here is my simple backup script
and all I want is the cp output to go to the screen and the file. I've
tried >&1 > filename, but that didn't do it. It just goes to the log
file. Well, let me know the secret. (also if you would tell me how to
right justify the OK, that would be cool too :-)


echo
echo Starting Rankin*Bertin, PLLC Backup......
echo

if
  smbmount  //tripod/c /mnt/tripod -o password=xxxxxx

then

  echo .....  Mount of //tripod/c.......................[  OK  ]
  echo
  echo .....  Beginning Copy of RBPLLC Files
  echo

  cp -Ruvf /home/samba/rbpllc /mnt/tripod/rbpllcbackup > /home/david/log

  echo .....  Backup Operation Completed................[  OK  ]
  echo
  echo .....  Unmounting //tripod/c......
  echo

    if
      umount /mnt/tripod

    then

      echo ..... Unmount of //tripod/c.....................[  OK  ]
      echo

    else

      echo ..... Unmount of //tripod/c.....................[Failed]
      echo

    fi

else

  echo
  echo Failed to mount //tripod/c ..... Exiting ......
  echo

fi

Thanks!

--
David C. Rankin, J.D., P.E.
RANKIN * BERTIN, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
(936) 715-9333
(936) 715-9339 fax



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to