Browse Source

mail if error

pull/22/head
azlux 7 years ago
parent
commit
2e55fa7bed
3 changed files with 10 additions and 1 deletions
  1. +2
    -1
      README.md
  2. +3
    -0
      log2ram
  3. +5
    -0
      log2ram.conf

+ 2
- 1
README.md View File

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


## Customize ## Customize
#### variables : #### 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 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 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: #### 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`. 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 View File

@@ -29,6 +29,9 @@ syncFromDisk () {
echo "ERROR: RAM disk too small. Can't sync." echo "ERROR: RAM disk too small. Can't sync."
umount -l $RAM_LOG umount -l $RAM_LOG
umount -l $HDD_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 exit 1
fi fi




+ 5
- 0
log2ram.conf View File

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


USE_RSYNC=false 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

Loading…
Cancel
Save