Skip to content

Instantly share code, notes, and snippets.

Last active Nov 30, 2021
What would you like to do?
A shell script to archive web logs on DreamHost.
# 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