[Unit] Description=Save logs from RAM-Disk to HDD DefaultDependencies=no Before=shutdown.target [Service] Type=oneshot ExecStart=/usr/local/bin/save_logs.sh RemainAfterExit=true [Install] WantedBy=halt.target reboot.target shutdown.target