Kaynağa Gözat

Configuration file added

tags/v1.1
azlux 7 yıl önce
ebeveyn
işleme
a54aee856d
4 değiştirilmiş dosya ile 19 ekleme ve 12 silme
  1. +3
    -8
      README.md
  2. +5
    -0
      install.sh
  3. +1
    -4
      log2ram
  4. +10
    -0
      log2ram.conf

+ 3
- 8
README.md Dosyayı Görüntüle

@@ -15,18 +15,13 @@ chmod +x install.sh
sudo ./install.sh
```

into /usr/local/bin/log2ram
- You can change the SIZE variable if necessary
- If you prefer to use rsync, you can set the USE_RSYNC variable to `true`


## Customize
#### variables :
Into the file `log2ram` (or `/usr/local/bin/log2ram` if you have already installed it), there are two variables into the script : `SIZE=40M` and `USE_RSYNC=false`

The first variable define the size the log folder will reserve into the RAM.
Into the file `/etc/log2ram.conf`, there are two variables :

The second variable can be set to `true` if you prefer "rsync" than "cp". I use the command `cp -u` and `rsync -X`, I don't copy the all folder every time for optimization.
- The first variable define the size the log folder will reserve into the RAM.
- The second variable can be set to `true` if you prefer "rsync" than "cp". I use the command `cp -u` and `rsync -X`, I don't copy the all folder every time for optimization.

#### refresh time:
The default is to write log into the HardDisk every hour. If you think this is too much, you can make the write every day by moving the cron file : `sudo mv /etc/cron.hourly/log2ram /etc/cron.daily/log2ram`.


+ 5
- 0
install.sh Dosyayı Görüntüle

@@ -6,6 +6,8 @@ then
chmod 644 /etc/systemd/system/log2ram.service
cp log2ram /usr/local/bin/log2ram
chmod a+x /usr/local/bin/log2ram
cp log2ram.conf /etc/log2ram.conf
chmod 644 /etc/log2ram.conf
systemctl enable log2ram
cp log2ram.hourly /etc/cron.hourly/log2ram
chmod +x /etc/cron.hourly/log2ram
@@ -14,3 +16,6 @@ then
else
echo "You need to be ROOT (sudo can be used)"
fi


-rw-r--r--

+ 1
- 4
log2ram Dosyayı Görüntüle

@@ -1,9 +1,6 @@
#!/bin/sh

SIZE=40M
USE_RSYNC=false

# don't touch anything below here.
source /etc/log2ram.conf

HDD_LOG=/var/log.hdd/
RAM_LOG=/var/log/


+ 10
- 0
log2ram.conf Dosyayı Görüntüle

@@ -0,0 +1,10 @@
# Configuration file for Log2Ram (https://github.com/azlux/log2ram) under MIT license.
# This configuration file is read by the log2ram service
# Size for the ram folder, it's define the size the log folder will reserve into the RAM. If it's not enough, log2ram will not be able to use ram. Check you /var/log size folder. The default is 40M and is basically enough for a lot of application. You will need to increase it if you have a server and a lot of log for example.

SIZE=40M

# This variable can be set to true if you prefer "rsync" than "cp". I use the command cp -u and rsync -X, so I don't copy the all folder every time for optimization.
# You can choose which one you want. Be sure rsync is installed if you use it.

USE_RSYNC=false

Yükleniyor…
İptal
Kaydet