Empty /var/log after running cron bash script
- by Ortix92
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.