How to setup a systemd '.service' that will start and stop at certain times with '.timer'?

Solution Verified - Updated -

Issue

  • How to start some daemon services via systemd (e.g. a java application in a .service) while having them only active during weekdays (Mon-Fri) and during office hours (08:00-18:00)?
  • systemd: unable to get '.timer' to work correctly
  • Is it possible to start and stop daemons at specific time intervals with systemd and without using cron?

Environment

  • systemd
  • Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content