[systemd-devel] StandardOutput=append

Kenneth Porter shiva at sewingwitch.com
Sat Aug 31 00:39:38 UTC 2019


I have a backup script that runs periodically via cron. Instead of mailing 
me a large log, I wanted to have it append to a log file that can be 
rotated and compressed by logrotate. So I removed my link from 
/etc/cron.hourly and created service and timer units.

My first cut at writing a log file was to use the append option to 
StandardOutput:

[Service]
ExecStart=/home/Mirror/rsync-Saruman.sh
StandardOutput=append:/var/log/rsync-Saruman.log

In /var/log/messages I see:

Failed to parse output specifier, ignoring: 
append:/var/log/rsync-Saruman.log

<https://www.freedesktop.org/software/systemd/man/systemd.exec.html>

Based on some hints at the following link, I think I'll change this to use 
syslog and add an rsyslog config file to redirect to the desired file. But 
I wanted to find out why the append feature doesn't work.

<https://stackoverflow.com/questions/37585758/how-to-redirect-output-of-systemd-service-to-a-file>



More information about the systemd-devel mailing list