Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@chuckhoupt
Last active November 30, 2021 11:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckhoupt/8541203 to your computer and use it in GitHub Desktop.
Save chuckhoupt/8541203 to your computer and use it in GitHub Desktop.
A shell script to archive web logs on DreamHost.
#!/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