项目作者: amlamarra

项目描述 :
A bash script to easily create, delete, & manage Systemd Timers.
高级语言: Shell
项目地址: git://github.com/amlamarra/timertab.git
创建时间: 2016-12-11T14:57:35Z
项目社区:https://github.com/amlamarra/timertab

开源协议:

下载


timertab

An easy way to create, delete, and manage your Systemd Timers.

  1. Usage: ./timertab [-u|--user] COMMAND [ARGUMENT...]
  2. Only use one command at a time
  3. -u, --user Deal only with user timers (not run as root)
  4. The .timer extension is optional when specifying a timer name.
  5. COMMANDS:
  6. help Display this help dialog
  7. list List the current timers
  8. new [NAME...] Create a new timer
  9. enable [NAME...] Enable timer
  10. start [NAME...] Start timer
  11. stop [NAME...] Stop timer
  12. status [NAME...] Display the status of a specific timer
  13. disable [NAME...] Disable timer
  14. remove [NAME...] Remove (delete) timer and/or associated service files
  15. modify [NAME...] Opens the .timer file for editing in vi
  16. run [NAME...] Run a command in a transient (temporary) timer
  17. convert Convert a cron job into a Systemd timer

Usage examples

  1. List all of the user’s timers:

    $ ./timertab -u list

  2. Create a user timer named “myscript”:

    $ ./timertab -u new myscript.timer (Note: The .timer extension is optional)

  3. Enable a timer:

    $ sudo ./timertab enable mytimer

  4. Deleting a timer file:

    $ sudo ./timertab remove mytimer

  5. Display the status of a timer:

    $ ./timertab status mytimer

  6. 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

Known Issues

  • 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/