You are not logged in.
I have this cron job script which also writes output to a log.
#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v -a >> $LOG
This is my service unit
[Unit]
Description=Weekly activate trim as per mount option in fstab.
ConditionACPower=true
[Service]
Type=oneshot
ExecStart=fstrim -v -a
[Install]
WantedBy=default.target
What I'm missing is how to write the output to its log.
Last edited by mrlamud (2018-06-20 08:37:50)
Offline
Why not use the existing fstrim.timer?
Other than that, systemd logs when timers starts and the process output, so you could rely on that instead of writing the log yourself.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
How stupid I'm!!!
Thanks for point this out.
Offline