Skip to content

Instantly share code, notes, and snippets.

@jgeiger
Created May 21, 2010 19:10
Show Gist options
  • Save jgeiger/409285 to your computer and use it in GitHub Desktop.
Save jgeiger/409285 to your computer and use it in GitHub Desktop.
# create a new cron job at panel.dreamhost.com and run it daily (which will be midnight)
/home/account/opt/bin/logrotate -f -s /home/account/opt/lib/logrotate.status /home/account/opt/etc/logrotate.conf
cd ~
mkdir -p opt/bin
mkdir -p opt/lib
mkdir -p opt/etc
mkdir src
cd src
wget http://www.sfr-fresh.com/unix/privat/logrotate-3.7.8.tar.gz
tar xfvz logrotate-3.7.8.tar.gz
cd logrotate-3.7.8
make
cp logrotate ~/opt/bin/
cd ~/opt/etc
vi logrotate.conf
# paste in the file
/home/account/website/shared/log/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
copytruncate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment