PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/silverlining/server-root/var/root/reset_for_backup

https://bitbucket.org/ianb/silverlining/
#! | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | 9a7fad0582340882b38311672204e31c MD5 | raw file
 1#!/bin/bash
 2
 3if [ "$(hostname)" != "base_image" ] ; then
 4    echo "This isn't the base_image host; so don't run this"
 5    exit 1
 6fi
 7
 8echo "Clearing /var/log/apache2"
 9rm /var/log/apache2/access.*
10rm /var/log/apache2/error.*
11echo "Clearing auth.log, btmp, wtmp"
12rm /var/log/auth.log* /var/log/btmp* /var/log/wtmp*
13echo "Clearing messages, syslog"
14rm /var/log/messages* /var/log/syslog*
15echo "Clearing kern.log, lpr.log fsck"
16rm /var/log/kern.log* /var/log/lpr.log* /var/log/fsck/*
17echo "Clearing daemon.log"
18rm /var/log/daemon.log*
19echo "Clearing dmesg, debug"
20rm /var/log/dmesg* /var/log/debug*
21echo "Clearing postgres logs"
22rm /var/log/postgresql/*
23
24apt-get clean