Why convert TIMER to SERVICE?
In systemd these are two halves of one job: the .timer says when, and the .SERVICE says what. So the realistic task is not conversion but writing the matching service unit that the timer triggers, either by default name match or via the Unit= directive.
How to convert TIMER to SERVICE
Any text editor FREE
Create a file with the same base name, e.g. backup.service next to backup.timer, adding a [Service] section with ExecStart= set to your command; the timer triggers it automatically by name.
systemctl edit FREE
Run systemctl edit --full --force backup.service to open a new unit in the correct directory, define ExecStart=, then systemctl daemon-reload and enable the timer.
About these formats
A .timer file is a systemd unit that schedules when another unit (usually a matching .service file) runs on Linux, working as a modern replacement for cron. It is a small plain-text file in…
Open .TIMER details →A .SERVICE file is associated with Mac OS X Service Application, a system file.
Open .SERVICE details →Quality & what to watch
- By default a
backup.timeractivatesbackup.service; useUnit=in the timer's[Timer]section only if the service name differs. - The service should typically be
Type=oneshotfor scheduled tasks so systemd treats each run as a discrete job. - After creating or changing the unit, run
systemctl daemon-reloador the timer won't pick up the new service.
Frequently asked questions
Can a timer run without a service?
.service unit that defines the command.How does the timer know which service to run?
foo.timer runs foo.service), unless you override it with Unit= in the timer file.Do I enable the timer or the service?
.timer; systemd starts the service on schedule for you.Where do these unit files live?
/etc/systemd/system/ for system-wide units, and run systemctl daemon-reload after editing.