mirror of
https://github.com/azlux/log2ram.git
synced 2023-10-10 13:37:24 +02:00
Create log2ram
This commit is contained in:
parent
3b40e22315
commit
1e00b9557e
25
log2ram
Normal file
25
log2ram
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user