An easy way to create, delete, and manage your Systemd Timers.
Usage: ./timertab [-u|--user] COMMAND [ARGUMENT...]
Only use one command at a time
-u, --user Deal only with user timers (not run as root)
The .timer extension is optional when specifying a timer name.
COMMANDS:
help Display this help dialog
list List the current timers
new [NAME...] Create a new timer
enable [NAME...] Enable timer
start [NAME...] Start timer
stop [NAME...] Stop timer
status [NAME...] Display the status of a specific timer
disable [NAME...] Disable timer
remove [NAME...] Remove (delete) timer and/or associated service files
modify [NAME...] Opens the .timer file for editing in vi
run [NAME...] Run a command in a transient (temporary) timer
convert Convert a cron job into a Systemd timer
-
List all of the user's timers:
$ ./timertab -u list
-
Create a user timer named "myscript":
$ ./timertab -u new myscript.timer
(Note: The .timer extension is optional) -
Enable a timer:
$ sudo ./timertab enable mytimer
-
Deleting a timer file:
$ sudo ./timertab remove mytimer
-
Display the status of a timer:
$ ./timertab status mytimer
-
Create a transient (temporary) timer.
These timer files are created in the /run/user/$UID/systemd/transient/ directory.
They are not "enabled" or "disabled" but will be deleted once they are stopped or there's a reboot.
Realtime timers will reoccur while Monotonic ones will only execute once after the specified amount of time.
If no name is provided, one will be automatically generated.$ ./timertab -u run mytimer
-
Unable to convert user cron jobs to root level timers
-
Workaround:
Do the conversion with the
--user
option, and move the files from ~/.config/systemd/user/ to /etc/systemd/system/
-