Re: systemd .service/.timer question (needing help)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you, Richard. you answered another question I had about one. I can now fix all of my cronjobs to be .service/.timer pairs.

Trever

On 06/15/2017 03:18 PM, Richard Shaw wrote:
On Thu, Jun 15, 2017 at 4:12 PM, Trever L. Adams <trever@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I am needing a bit of help. I am converting some of my old crontab
entries to xxx.timer and xxx.service systemd files. I have the following
(the system is a backup server that can be woken by magic packets or
some amount of time before the backups run):

ExecStart=/usr/sbin/rtcwake -m mem -t $(/usr/bin/date +\%s -d 'today
23:50') > /dev/null

It yeilds:

Invalid escape sequences in line, correcting: "/usr/sbin/rtcwake -m mem
-t $(/usr/bin/date +\%s -d 'today 23:50') > /dev/null"


Is there a way to correct this easily, or am I going to have to turn
that line into a separate shell script?

SystemD executes the binaries directly without a shell so you can't use shell variables and such. You could write a script or I think prepending /usr/bin/bash on the front may work. You may need to put the commands in quotes. Google should find you an example.

Thanks,
Richard 


_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux