send all output to file, gzip in crontab
13 11 * * * /home/devin/Desktop/bla.sh &> /home/devin/Desktop/bla.log | exec /bin/gzip ;
can someone tell me why it dows not work please help |
Hi,
that looks like it wouldn't even work on the command line. How about the following: Code:
/home/devin/Desktop/bla.sh 2>&1 | /bin/gzip - > /home/devin/Desktop/bla.log.gz |
Oops, you actually explicitly asked why it wouldn't work. Hmm..
Firstly you have "&>" which will background the process and send the stdout to the file /home/devin/Desktop/bla.log (Perhaps you wanted ">&" or "2>&1" which will send stderr to stdout). Next you have a pipe, "|" to "exec /bin/gzip"... there a number of issues here. Why the "exec"? And gzip will only take stdin as input if given "-" as the input file etc, and you've already redirected the output of your script to bla.log. HTH, Evo2. |
Quote:
|
Quote:
|
yes, you can but it depends on the size of that file. See the man page of mailx: http://linux.die.net/man/1/mailx, you can try something like this:
echo "this is the log file of ... at ...." | mailx -s <subject> -a <attachment> <your address> |
All times are GMT -5. The time now is 04:07 AM. |