logo

cmd-timer

run command at a specific interval git clone https://anongit.hacktivis.me/git/cmd-timer.git

timer.1 (1104B)


  1. .\" SPDX-FileCopyrightText: 2025 Haelwenn (lanodan) Monnier <contact+cmd-timer@hacktivis.me>
  2. .\" SPDX-License-Identifier: MPL-2.0
  3. .Dd June 18, 2025
  4. .Dt TIMER 1
  5. .Os
  6. .Sh NAME
  7. .Nm timer
  8. .Nd run command at a specific interval
  9. .Sh SYNOPSIS
  10. .Nm
  11. .Ar interval
  12. .Ar command
  13. .Op Ar arguments
  14. .Sh DESCRIPTION
  15. The
  16. .Nm
  17. utility runs
  18. .Ar command
  19. at every
  20. .Ar interval .
  21. .Pp
  22. .Ar interval
  23. is a string containing non-negative decimal numbers including floats, terminated by suffixes:
  24. s for seconds, m for minutes, h for hours, d for days.
  25. .br
  26. If the final number doesn't have a suffix, seconds are assumed.
  27. Longer durations are taken as out of scope.
  28. .Pp
  29. If
  30. .Ar command
  31. exits with a non-zero status,
  32. .Nm
  33. exits with the same status, allowing to use service supervision to track failures.
  34. .Sh EXIT STATUS
  35. .Ex -std
  36. .Sh EXAMPLES
  37. .Bl -bullet
  38. .It
  39. Run
  40. .Cm munin-cron
  41. every 5 minutes:
  42. .Nm
  43. .Ar 5m munin-cron
  44. .It
  45. Print bell every minute and a half:
  46. .Nm
  47. .Ar 1m30s printf '\ea'
  48. .El
  49. .Sh SEE ALSO
  50. .Xr at 1 ,
  51. .Xr crontab 1 ,
  52. .Xr sleep 1 ,
  53. .Xr timer_create 3
  54. .Sh AUTHORS
  55. .An Haelwenn (lanodan) Monnier Aq Mt contact+cmd-timer@hacktivis.me