Last active
August 29, 2015 13:57
-
-
Save nagataka/9533188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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