Ver código fonte

Create log2ram

pull/1/head
azlux 8 anos atrás
pai
commit
1e00b9557e
1 arquivos alterados com 25 adições e 0 exclusões
  1. +25
    -0
      log2ram

+ 25
- 0
log2ram Ver arquivo

@@ -0,0 +1,25 @@
#!/bin/sh

HDD_LOG=/var/log.hdd/
RAM_LOG=/var/log/
SIZE=40M

case "$1" in
start)
[ -d $HDD_LOG ] || mkdir $HDD_LOG
mount --bind $RAM_LOG $HDD_LOG
mount --make-private $HDD_LOG
mount -t tmpfs -o nosuid,noexec,nodev,mode=0755,size=$SIZE ramlog $RAM_LOG
cp -rfup $HDD_LOG -T $RAM_LOG
;;

stop)
cp -rfup $RAM_LOG -T $HDD_LOG
umount -l $RAM_LOG
umount -l $HDD_LOG
;;

write)
cp -rfup $RAM_LOG -T $HDD_LOG
;;
esac

Carregando…
Cancelar
Salvar