Files
stormux/pi4/files/etc/systemd/system/log-to-ram-setup.service

16 lines
449 B
Desktop File

[Unit]
Description=Setup RAM logging and restore logs from disk
DefaultDependencies=false
After=local-fs.target
Before=sysinit.target
RequiresMountsFor=/var
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /var/log.hdd
ExecStartPre=/bin/sh -c 'if [ -d /var/log.hdd ] && [ "$(ls -A /var/log.hdd 2>/dev/null)" ]; then cp -au /var/log.hdd/* /var/log/ 2>/dev/null || true; fi'
ExecStart=/bin/true
[Install]
WantedBy=sysinit.target