diff --git a/inxi b/inxi index 6491954..0adb98a 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.0.13-b1 +#### version: 1.0.13-b2 #### Date: 28 May 2009 ######################################################################## #### SPECIAL THANKS @@ -791,9 +791,8 @@ create_rotate_logfiles() if [[ ! -d $SCRIPT_DATA_DIR ]];then mkdir $SCRIPT_DATA_DIR fi - if [[ ! -f $LOG_FILE ]];then - touch $LOG_FILE - else + # do the rotation if logfile exists + if [[ -f $LOG_FILE ]];then # copy if present second to third if [[ -f $LOG_FILE_1 ]];then mv -f $LOG_FILE_1 $LOG_FILE_2 @@ -801,6 +800,9 @@ create_rotate_logfiles() # then copy initial to second mv -f $LOG_FILE $LOG_FILE_1 fi + # now create the logfile + touch $LOG_FILE + # and echo the start data echo "=========================================================" >> $LOG_FILE echo "START $SCRIPT_NAME LOGGING:" >> $LOG_FILE echo "Script started: $( date +%Y-%m-%d-%H:%M:%S )" >> $LOG_FILE