You are not logged in.
I setup a systemd service and timer to run weekly, but I don't know if it is setup correctly.
How I setup the service and timers was I first created a bash script in /usr/local/bin
#!/bin/bash
/usr/bin/profile-cleaner -c &
/usr/bin/browser-vacuum
I then made it executable with sudo chmod +x myscripts.
I created the following service myscripts.service file in /etc/systemd/system
[Unit]
Description=runs a script that calls profile-cleaner -c and browser-vacuum
[Service]
WorkingDirectory=/usr/local/bin
Type=simple
ExecStart=/bin/bash myscript
[Install]
WantedBy=mytimer.target
Next I created a mytimer.timer file in /etc/systemd/system
[Unit]
Description=Run my timers services weekly
[Timer]
OnCalendar=weekly
Persistent=true
Unit=myscripts.service
[Install]
WantedBy=multi-user.target
Will this setup work or am I missing something in the setup process?
Thanks.
Last edited by dwsmith (2015-04-27 21:55:13)
Offline
Offline
The timer and the service file need to have the same basename (i.e. myscript.service and myscript.timer). Hopefully you referenced this :-;
Scott
Other than the uniform name, it should be okay?
Offline
The timer and the service file need to have the same basename (i.e. myscript.service and myscript.timer).
Not true (see your own link). But it might be simpler to stick to that convention.
It is strange to set the working directory and then pass a relative path to /bin/bash. Similarly, why chmod +x the script if you're going to invoke /bin/bash explicitly?
The [Install] section in the .service file is also not needed unless you want to do something else with that mytimer.target.
Offline