I wanted to use systemd to archive some logs periodically. However, it does not work as I wanted it to. According to my test, the second part of in string command failed and I really have no idea what going wrong. Would appreciate if anyone could give me some pointer. Thanks.
Inside Unit File:
ExecStart=/bin/tar -zcvf "/var/log/test/$(/bin/date)_syslog_archive.tar.gz" "/tmp/log/"
Getting error:
Main process exited, code=exited, status=2/INVALIDARGUMENT