0

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.

1
  • There's no reason why this would have affected any files other than /var/log/stl_upload.log. There's something else going on.
    – terdon
    Jun 6, 2014 at 8:41

2 Answers 2

0

It is still unknown what happened, but a server reboot regenerated the log files again (had to touch a couple manually). Still very strange issue, but as we are moving to a new environment (managed by a 3rd party) this week, this question is considered answered.

0

Just curious, your logrotate or syslog.conf config might be archiving logs to a different directory? And it was all just coincidence? Can't think of any other reason. (I realize this question is answered, I'm just curious too)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .