Przeglądaj źródła

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 lat temu
rodzic
commit
e238849069
3 zmienionych plików z 10 dodań i 2 usunięć
  1. +4
    -2
      install.sh
  2. +3
    -0
      log2ram
  3. +3
    -0
      log2ram.hourly

+ 4
- 2
install.sh Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

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

/usr/local/bin/log2ram write

Ładowanie…
Anuluj
Zapisz