- If invalid command, display: start, stop, write.
- Created isSafe to display an error message and bail if the hdd log
directory doesn't exist.
- Split out customizable parameters.
Since the normal log2ram log isn't in /var/log, it won't be handled by
logrotate, so it should be removed on startup to prevent it from
growing indefinitely.
We should also figure out some way to let it be processed by
logrotate, but that'd be really tricky to do well. Maybe just kludge
it by removing all but the last 10 lines if the file is greater than
SIZE?
* Write sync status to HDD_LOG/log2ram.log.
- Store sync status directly in the HDD log, to make sure we know
about it if something fails. This won't help if the HDD_LOG
variable is borked, but it'll help with everything else.
- Made sync a function to avoid repeating five lines three times.
- log2ram now requires (cp or rsync) and tee, mount, umount.
* Split sync into syncFromDisk and syncToDisk.
- After restarting, I realized that I had combined both types of sync
into one line, when the syncing failed. This fixes that bug.
* Exclude log2ram.log from rsync so rsync doesn't delete it on sync.
- 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.
- Store sync status directly in the HDD log, to make sure we know
about it if something fails. This won't help if the HDD_LOG
variable is borked, but it'll help with everything else.
- Made sync a function to avoid repeating five lines three times.
- log2ram now requires (cp or rsync) and tee, mount, umount.
From @datenklause
With Type=oneshot, systemd waits until the start action has completed
before it considers the unit to be active, so dependencies start only
after the start action has succeeded. With Type=simple, dependencies
will start immediately after the start action has been dispatched.