RAM Log

sudo apt-get update
sudo apt-get upgrade
sudo wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
sudo dpkg -i ramlog_2.0.0_all.deb
sudo reboot
sudo reboot

# cd /tmp/
# sudo apt-get install lsof
# wget http://www.tremende.com/ramlog/download/ramlog-2.0.0.tar.gz
# tar -xvf ramlog-2.0.0.tar.gz
# cd ramlog-2.0.0
# cp -a ramlog /etc/init.d/ramlog
# cp -a ramlog.8.gz /usr/share/man/man8/ramlog.8.gz
# cp -a ramlog.cron /etc/cron.daily #or to other dir based on your need
# cp -a ramlog.logrotate /etc/logrotate.d/ramlog
# cp -a ramlog.conf /etc/default/ramlog
# /etc/init.d/ramlog getlogsize

 

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Setting Up /var/log"
    mkdir /tmp/var_log
    /usr/bin/rsync --archive --delete /var/log/ /tmp/var_log
    /bin/mount --bind /tmp/var_log /var/log
    add_daemon tmpvarlog
    stat_done
    ;;
  stop)
    stat_busy "Saving /var/log To Disk"
    /bin/umount /var/log
    /usr/bin/rsync --archive --delete /tmp/var_log/ /var/log
    rm -rf /tmp/var_log
    rm_daemon tmpvarlog
    stat_done
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0