How to use
- Enter the service name, the command with its full path and the working directory.
- Set the user, restart policy and any environment variables.
- Optionally add basic hardening or a schedule (OnCalendar) to create a timer.
- Copy the generated files, or paste the install commands into a root shell on the server.
Options explained
- Type
- simple suits programs that stay in the foreground; oneshot suits scripts that run once, such as scheduled jobs.
- Restart
- On failure restarts the service when it exits with an error or crashes; Always also restarts it after a normal exit.
- OnCalendar
- When the timer fires, e.g. daily or *-*-* 03:00:00 for 3 a.m. every day. Test expressions with systemd-analyze calendar.
Example: a nightly job as a timer
To run a script every night at 3 a.m., set the Command (ExecStart) to /usr/local/bin/backup.sh, the service name to backup, Type to oneshot and Restart to Never, then tick “Run on a schedule (create a .timer)” and “Basic hardening”. With the default user and working directory, the generator produces two files. backup.service:
[Unit]
Description=Nightly backup
[Service]
Type=oneshot
User=www-data
WorkingDirectory=/srv/myapp
ExecStart=/usr/local/bin/backup.sh
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=read-only
and backup.timer:
[Unit]
Description=Run backup on a schedule
[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true
Unit=backup.service
[Install]
WantedBy=timers.target
Two things change when a timer is on. The service file loses its [Install] section, because the timer starts it instead, and the install commands enable the timer rather than the service:
sudo systemctl daemon-reload
sudo systemctl enable --now backup.timer
systemctl list-timers backup.timer
journalctl -u backup.service -f
The Type is not changed for you when you tick the timer option, so choose oneshot yourself for jobs that finish. A oneshot service combined with Restart Always is not valid, so the generator leaves Restart out and shows a warning.
Frequently asked questions
Where do I put the file?
In /etc/systemd/system/. Then run systemctl daemon-reload and systemctl enable --now <name>.service — the generated commands do all of this.
Why does my service fail with “Executable path is not absolute”?
Older systemd versions need the full path to the program in ExecStart. Find it with which, e.g. which node.
Timer or cron?
Timers log to the journal, can catch up on runs missed while the server was off, and never run twice at once. cron is simpler for one-liners and still works fine.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.