Skip to content

Instantly share code, notes, and snippets.

@chuckhoupt chuckhoupt/archive_logs
Last active Jan 4, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.