{
    "mode": "man",
    "parameter": "SYSTEMD.TIMER",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/SYSTEMD.TIMER/5/json",
    "generated": "2026-05-30T15:36:41Z",
    "synopsis": "timer.timer",
    "sections": {
        "NAME": {
            "content": "systemd.timer - Timer unit configuration\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "timer.timer\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "A unit configuration file whose name ends in \".timer\" encodes information about a timer\ncontrolled and supervised by systemd, for timer-based activation.\n\nThis man page lists the configuration options specific to this unit type. See systemd.unit(5)\nfor the common options of all unit configuration files. The common configuration items are\nconfigured in the generic [Unit] and [Install] sections. The timer specific configuration\noptions are configured in the [Timer] section.\n\nFor each timer file, a matching unit file must exist, describing the unit to activate when\nthe timer elapses. By default, a service by the same name as the timer (except for the\nsuffix) is activated. Example: a timer file foo.timer activates a matching service\nfoo.service. The unit to activate may be controlled by Unit= (see below).\n\nNote that in case the unit to activate is already active at the time the timer elapses it is\nnot restarted, but simply left running. There is no concept of spawning new service instances\nin this case. Due to this, services with RemainAfterExit= set (which stay around continuously\neven after the service's main process exited) are usually not suitable for activation via\nrepetitive timers, as they will only be activated once, and then stay around forever.\n",
            "subsections": []
        },
        "AUTOMATIC DEPENDENCIES": {
            "content": "",
            "subsections": [
                {
                    "name": "Implicit Dependencies",
                    "content": "The following dependencies are implicitly added:\n\n•   Timer units automatically gain a Before= dependency on the service they are supposed to\nactivate.\n"
                },
                {
                    "name": "Default Dependencies",
                    "content": "The following dependencies are added unless DefaultDependencies=no is set:\n\n•   Timer units will automatically have dependencies of type Requires= and After= on\nsysinit.target, a dependency of type Before= on timers.target, as well as Conflicts= and\nBefore= on shutdown.target to ensure that they are stopped cleanly prior to system\nshutdown. Only timer units involved with early boot or late system shutdown should\ndisable the DefaultDependencies= option.\n\n•   Timer units with at least one OnCalendar= directive acquire a pair of additional After=\ndependencies on time-set.target and time-sync.target, in order to avoid being started\nbefore the system clock has been correctly set. See systemd.special(7) for details on\nthese two targets.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "Timer files must include a [Timer] section, which carries information about the timer it\ndefines. The options specific to the [Timer] section of timer units are the following:\n\nOnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=\nDefines monotonic timers relative to different starting points:\n\nTable 1. Settings and their starting points\n┌───────────────────┬───────────────────────────────────┐\n│Setting            │ Meaning                           │\n├───────────────────┼───────────────────────────────────┤\n│OnActiveSec=       │ Defines a timer relative to the   │\n│                   │ moment the timer unit itself is   │\n│                   │ activated.                        │\n├───────────────────┼───────────────────────────────────┤\n│OnBootSec=         │ Defines a timer relative to when  │\n│                   │ the machine was booted up. In     │\n│                   │ containers, for the system        │\n│                   │ manager instance, this is mapped  │\n│                   │ to OnStartupSec=, making both     │\n│                   │ equivalent.                       │\n├───────────────────┼───────────────────────────────────┤\n│OnStartupSec=      │ Defines a timer relative to when  │\n│                   │ the service manager was first     │\n│                   │ started. For system timer units   │\n│                   │ this is very similar to           │\n│                   │ OnBootSec= as the system service  │\n│                   │ manager is generally started very │\n│                   │ early at boot. It's primarily     │\n│                   │ useful when configured in units   │\n│                   │ running in the per-user service   │\n│                   │ manager, as the user service      │\n│                   │ manager is generally started on   │\n│                   │ first login only, not already     │\n│                   │ during boot.                      │\n├───────────────────┼───────────────────────────────────┤\n│OnUnitActiveSec=   │ Defines a timer relative to when  │\n│                   │ the unit the timer unit is        │\n│                   │ activating was last activated.    │\n├───────────────────┼───────────────────────────────────┤\n│OnUnitInactiveSec= │ Defines a timer relative to when  │\n│                   │ the unit the timer unit is        │\n│                   │ activating was last deactivated.  │\n└───────────────────┴───────────────────────────────────┘\nMultiple directives may be combined of the same and of different types, in which case the\ntimer unit will trigger whenever any of the specified timer expressions elapse. For\nexample, by combining OnBootSec= and OnUnitActiveSec=, it is possible to define a timer\nthat elapses in regular intervals and activates a specific service each time. Moreover,\nboth monotonic time expressions and OnCalendar= calendar expressions may be combined in\nthe same timer unit.\n\nThe arguments to the directives are time spans configured in seconds. Example:\n\"OnBootSec=50\" means 50s after boot-up. The argument may also include time units.\nExample: \"OnBootSec=5h 30min\" means 5 hours and 30 minutes after boot-up. For details\nabout the syntax of time spans, see systemd.time(7).\n\nIf a timer configured with OnBootSec= or OnStartupSec= is already in the past when the\ntimer unit is activated, it will immediately elapse and the configured unit is started.\nThis is not the case for timers defined in the other directives.\n\nThese are monotonic timers, independent of wall-clock time and timezones. If the computer\nis temporarily suspended, the monotonic clock generally pauses, too. Note that if\nWakeSystem= is used, a different monotonic clock is selected that continues to advance\nwhile the system is suspended and thus can be used as the trigger to resume the system.\n\nIf the empty string is assigned to any of these options, the list of timers is reset\n(both monotonic timers and OnCalendar= timers, see below), and all prior assignments will\nhave no effect.\n\nNote that timers do not necessarily expire at the precise time configured with these\nsettings, as they are subject to the AccuracySec= setting below.\n\nOnCalendar=\nDefines realtime (i.e. wallclock) timers with calendar event expressions. See\nsystemd.time(7) for more information on the syntax of calendar event expressions.\nOtherwise, the semantics are similar to OnActiveSec= and related settings.\n\nNote that timers do not necessarily expire at the precise time configured with this\nsetting, as it is subject to the AccuracySec= setting below.\n\nMay be specified more than once, in which case the timer unit will trigger whenever any\nof the specified expressions elapse. Moreover calendar timers and monotonic timers (see\nabove) may be combined within the same timer unit.\n\nIf the empty string is assigned to any of these options, the list of timers is reset\n(both OnCalendar= timers and monotonic timers, see above), and all prior assignments will\nhave no effect.\n\nAccuracySec=\nSpecify the accuracy the timer shall elapse with. Defaults to 1min. The timer is\nscheduled to elapse within a time window starting with the time specified in OnCalendar=,\nOnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec= or OnUnitInactiveSec= and\nending the time configured with AccuracySec= later. Within this time window, the expiry\ntime will be placed at a host-specific, randomized, but stable position that is\nsynchronized between all local timer units. This is done in order to optimize power\nconsumption to suppress unnecessary CPU wake-ups. To get best accuracy, set this option\nto 1us. Note that the timer is still subject to the timer slack configured via systemd-\nsystem.conf(5)'s TimerSlackNSec= setting. See prctl(2) for details. To optimize power\nconsumption, make sure to set this value as high as possible and as low as necessary.\n\nNote that this setting is primarily a power saving option that allows coalescing CPU\nwake-ups. It should not be confused with RandomizedDelaySec= (see below) which adds a\nrandom value to the time the timer shall elapse next and whose purpose is the opposite:\nto stretch elapsing of timer events over a longer period to reduce workload spikes. For\nfurther details and explanations and how both settings play together, see below.\n\nRandomizedDelaySec=\nDelay the timer by a randomly selected, evenly distributed amount of time between 0 and\nthe specified time value. Defaults to 0, indicating that no randomized delay shall be\napplied. Each timer unit will determine this delay randomly before each iteration, and\nthe delay will simply be added on top of the next determined elapsing time, unless\nmodified with FixedRandomDelay=, see below.\n\nThis setting is useful to stretch dispatching of similarly configured timer events over a\ncertain time interval, to prevent them from firing all at the same time, possibly\nresulting in resource congestion.\n\nNote the relation to AccuracySec= above: the latter allows the service manager to\ncoalesce timer events within a specified time range in order to minimize wakeups, while\nthis setting does the opposite: it stretches timer events over an interval, to make it\nunlikely that they fire simultaneously. If RandomizedDelaySec= and AccuracySec= are used\nin conjunction, first the randomized delay is added, and then the result is possibly\nfurther shifted to coalesce it with other timer events happening on the system. As\nmentioned above AccuracySec= defaults to 1 minute and RandomizedDelaySec= to 0, thus\nencouraging coalescing of timer events. In order to optimally stretch timer events over a\ncertain range of time, set AccuracySec=1us and RandomizedDelaySec= to some higher value.\n\nFixedRandomDelay=\nTakes a boolean argument. When enabled, the randomized offset specified by\nRandomizedDelaySec= is reused for all firings of the same timer. For a given timer unit,\nthe offset depends on the machine ID, user identifier and timer name, which means that it\nis stable between restarts of the manager. This effectively creates a fixed offset for an\nindividual timer, reducing the jitter in firings of this timer, while still avoiding\nfiring at the same time as other similarly configured timers.\n\nThis setting has no effect if RandomizedDelaySec= is set to 0. Defaults to false.\n\nOnClockChange=, OnTimezoneChange=\nThese options take boolean arguments. When true, the service unit will be triggered when\nthe system clock (CLOCKREALTIME) jumps relative to the monotonic clock\n(CLOCKMONOTONIC), or when the local system timezone is modified. These options can be\nused alone or in combination with other timer expressions (see above) within the same\ntimer unit. These options default to false.\n\nUnit=\nThe unit to activate when this timer elapses. The argument is a unit name, whose suffix\nis not \".timer\". If not specified, this value defaults to a service that has the same\nname as the timer unit, except for the suffix. (See above.) It is recommended that the\nunit name that is activated and the unit name of the timer unit are named identically,\nexcept for the suffix.\n\nPersistent=\nTakes a boolean argument. If true, the time when the service unit was last triggered is\nstored on disk. When the timer is activated, the service unit is triggered immediately if\nit would have been triggered at least once during the time when the timer was inactive.\nSuch triggering is nonetheless subject to the delay imposed by RandomizedDelaySec=. This\nis useful to catch up on missed runs of the service when the system was powered down.\nNote that this setting only has an effect on timers configured with OnCalendar=. Defaults\nto false.\n\nUse systemctl clean --what=state ...  on the timer unit to remove the timestamp file\nmaintained by this option from disk. In particular, use this command before uninstalling\na timer unit. See systemctl(1) for details.\n\nWakeSystem=\nTakes a boolean argument. If true, an elapsing timer will cause the system to resume from\nsuspend, should it be suspended and if the system supports this. Note that this option\nwill only make sure the system resumes on the appropriate times, it will not take care of\nsuspending it again after any work that is to be done is finished. Defaults to false.\n\nNote that this functionality requires privileges and is thus generally only available in\nthe system service manager.\n\nNote that behaviour of monotonic clock timers (as configured with OnActiveSec=,\nOnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=, see above) is altered\ndepending on this option. If false, a monotonic clock is used that is paused during\nsystem suspend (CLOCKMONOTONIC), if true a different monotonic clock is used that\ncontinues advancing during system suspend (CLOCKBOOTTIME), see clockgetres(2) for\ndetails.\n\nRemainAfterElapse=\nTakes a boolean argument. If true, a timer will stay loaded, and its state remains\nqueryable even after it elapsed and the associated unit (as configured with Unit=, see\nabove) deactivated again. If false, an elapsed timer unit that cannot elapse anymore is\nunloaded once its associated unit deactivated again. Turning this off is particularly\nuseful for transient timer units. Note that this setting has an effect when repeatedly\nstarting a timer unit: if RemainAfterElapse= is on, starting the timer a second time has\nno effect. However, if RemainAfterElapse= is off and the timer unit was already unloaded,\nit can be started again, and thus the service can be triggered multiple times. Defaults\nto true.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "systemd(1), systemctl(1), systemd.unit(5), systemd.service(5), systemd.time(7),\nsystemd.directives(7), systemd-system.conf(5), prctl(2)\n\n\n\nsystemd 249                                                                         SYSTEMD.TIMER(5)",
            "subsections": []
        }
    },
    "summary": "systemd.timer - Timer unit configuration",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "systemd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
        },
        {
            "name": "systemctl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
        },
        {
            "name": "systemd.unit",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.unit/5/json"
        },
        {
            "name": "systemd.service",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.service/5/json"
        },
        {
            "name": "systemd.time",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.time/7/json"
        },
        {
            "name": "systemd.directives",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.directives/7/json"
        },
        {
            "name": "systemd-system.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-system.conf/5/json"
        },
        {
            "name": "prctl",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/prctl/2/json"
        }
    ]
}