Ver código fonte

Sync the ramlog back to disk, hourly.

- Since the cron job could be called before the user reboots after
  install (or if log2ram is disabled), we check that the hdd log
  location exists before syncing.

- Copy the log2ram.hourly sync script to cron's hourly directory on
  install.
pull/8/head
Nick Daly 8 anos atrás
pai
commit
e238849069
3 arquivos alterados com 10 adições e 2 exclusões
  1. +4
    -2
      install.sh
  2. +3
    -0
      log2ram
  3. +3
    -0
      log2ram.hourly

+ 4
- 2
install.sh Ver arquivo

@@ -7,8 +7,10 @@ then
cp log2ram /usr/local/bin/log2ram
chmod a+x /usr/local/bin/log2ram
systemctl enable log2ram
cp log2ram.hourly /etc/cron.hourly/log2ram
chmod +x /etc/cron.hourly/log2ram

echo "Reboot to activate log2ram"
else
else
echo "You need to be ROOT (sudo can be used)"
fi

+ 3
- 0
log2ram Ver arquivo

@@ -7,6 +7,9 @@ SIZE=40M
USE_RSYNC=false

sync () {
[ -d $HDD_LOG ] || echo "ERROR: $HDD_LOG doesn't exist! Can't sync."
[ -d $HDD_LOG ] || exit 1

if [ "$USE_RSYNC" = true ]; then
rsync -aXWv --delete --links $HDD_LOG $RAM_LOG 2>&1 | tee -a $LOG2RAM_LOG
else


+ 3
- 0
log2ram.hourly Ver arquivo

@@ -0,0 +1,3 @@
#! /bin/sh

/usr/local/bin/log2ram write

Carregando…
Cancelar
Salvar