Skip to content

Instantly share code, notes, and snippets.

@nagataka
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save nagataka/9533188 to your computer and use it in GitHub Desktop.

Select an option

Save nagataka/9533188 to your computer and use it in GitHub Desktop.
#!/bin/sh
##############################
source /opt/conf/httpd_switch_log.conf
##############################
DATE=`date +%Y%m%d`
echo "switch httpd log"+`date` >> $LOG_FILE
mv $HTTPD_LOG_DIR/access_log $HTTPD_LOG_DIR/access_log.$DATE
if [ $? -eq 0 ]
then
apachectl graceful
echo "finish switching httpd log "`date` >> $LOG_FILE
else
echo "an error occured `date`" >> $LOG_FILE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment