Bläddra i källkod

mail if error

pull/22/head
azlux 7 år sedan
förälder
incheckning
2e55fa7bed
3 ändrade filer med 10 tillägg och 1 borttagningar
  1. +2
    -1
      README.md
  2. +3
    -0
      log2ram
  3. +5
    -0
      log2ram.conf

+ 2
- 1
README.md Visa fil

@@ -18,10 +18,11 @@ sudo ./install.sh

## Customize
#### variables :
Into the file `/etc/log2ram.conf`, there are two variables :
Into the file `/etc/log2ram.conf`, there are three variables :

- 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.
- The last varibale disable the error system mail if there are no enought place on RAM (if set on false)

#### 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`.


+ 3
- 0
log2ram Visa fil

@@ -29,6 +29,9 @@ syncFromDisk () {
echo "ERROR: RAM disk too small. Can't sync."
umount -l $RAM_LOG
umount -l $HDD_LOG
if [ "$MAIL" = true ]; then
echo "LOG2RAM : No place on RAM anymore, fallback on the disk" | mail -s 'Log2Ram Error' root;
fi
exit 1
fi



+ 5
- 0
log2ram.conf Visa fil

@@ -8,3 +8,8 @@ SIZE=40M
# You can choose which one you want. Be sure rsync is installed if you use it.

USE_RSYNC=false

# If there are some error with available RAM space, a system mail will be send
# Change it to false, and you will have only log if there are no place on RAM anymore.

MAIL=true

Laddar…
Avbryt
Spara