Empty /var/log after running cron bash script

Posted by Ortix92 on Super User See other posts from Super User or by Ortix92
Published on 2014-06-06T08:30:12Z Indexed on 2014/06/06 9:28 UTC
Read the original article Hit count: 324

Filed under:
|
|

I wrote a little bash script and all of a sudden my /var/log folder is completely empty except for the log I created for the bash script.

This is the script I'm running every hour with cron:

#!/bin/bash
STL_DIR=/path/to/some/folder/i/hid
LOGFILE=/var/log/stl_upload.log

now=`date`
echo "----------Start of Transmission----------" 2>&1 | tee -a $LOGFILE
echo "Starting transfer at $now" 2>&1 | tee -a $LOGFILE

rsync -av -e ssh $STL_DIR [email protected]:/users/path/folder 2>&1 | tee -a $LOGFILE

echo "----------End of transmission----------" 2>&1 | tee -a $LOGFILE
printf "\n" 2>&1 | tee -a $LOGFILE

I want to be clear that I'm not 100% certain this is related to the empty logs folder. So if anyone could give me a pointer as to what could be going on about the reason why my log folder is empty, that'd be great.

© Super User or respective owner

Related posts about linux

Related posts about bash