Last active
November 30, 2021 11:47
-
-
Save chuckhoupt/8541203 to your computer and use it in GitHub Desktop.
A shell script to archive web logs on DreamHost.
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 | |
# DreamHost Web Log Archiver | |
# | |
# DreamHost only stores web logs for a few days (configurable 3-30 days), | |
# so to maintain long term logs, an archive copy must be maintained. | |
# | |
# This script copies new gzipped http/https log files from logs/ to | |
# logs_archive/ | |
# | |
# Setup as a daily cron job: | |
# @daily ./cronic ./archive_logs | |
set -eux | |
rsync -avL \ | |
--include='/*/' --include='http/' --include='https/' --include='*.gz' \ | |
--exclude='*' \ | |
~/logs/ ~/logs_archive/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment