Created
August 10, 2024 13:42
-
-
Save QuiltMeow/0dcb5be3c3c3d67aae9bfcb8b85a41f0 to your computer and use it in GitHub Desktop.
Log Compress
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/bash | |
| # 0 3 * * * /home/quilt/storage_firewall_log.sh | |
| LOG_PATH=/var/log/172.16.204.252 | |
| LOG_FILE="date=$(date +%Y-%m-%d -d -1day).log" | |
| COMPRESS_FILE="Firewall-$(date +%Y-%m-%d -d -1day).tar.xz" | |
| STORAGE_PATH=/home/quilt/log | |
| cd $LOG_PATH | |
| tar Jcvf $COMPRESS_FILE $LOG_FILE | |
| mv $COMPRESS_FILE "$STORAGE_PATH"/"$COMPRESS_FILE" | |
| rm -f $LOG_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment