diff --git a/install.sh b/install.sh index 04e15c6..97a5766 100644 --- a/install.sh +++ b/install.sh @@ -11,6 +11,7 @@ then systemctl enable log2ram cp log2ram.hourly /etc/cron.hourly/log2ram chmod +x /etc/cron.hourly/log2ram + /usr/local/bin/log2ram init echo "##### Reboot to activate log2ram #####" else diff --git a/log2ram b/log2ram index 9ef90d5..0f455e8 100755 --- a/log2ram +++ b/log2ram @@ -57,6 +57,12 @@ case "$1" in write) syncToDisk ;; + + init) + [ -d $HDD_LOG ] || mkdir $HDD_LOG + cp -rfup $RAM_LOG -T $HDD_LOG 2>&1 | $LOG_OUTPUT + ;; + *) echo "Usage: log2ram {start|stop|write}" >&2 exit 1