diff --git a/README.md b/README.md index d5bc721..65c97f7 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/log2ram b/log2ram index 48a197f..4407959 100755 --- a/log2ram +++ b/log2ram @@ -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 diff --git a/log2ram.conf b/log2ram.conf index 311dca6..1eb33f3 100644 --- a/log2ram.conf +++ b/log2ram.conf @@ -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 \ No newline at end of file