Config-Model-Systemd

 view release on metacpan or  search on metacpan

lib/Config/Model/models/Systemd/Section/Timer.pl  view on Meta::CPAN

elapsing time. This setting only has an effect on timers configured with C<OnCalendar>,
and it can be combined with C<RandomizedDelaySec>.

Much like C<RandomizedDelaySec>, this setting is for distributing timer events
to prevent them from firing all at once. However, this setting is most useful to prevent resource
congestion on a remote service, from a fleet of similarly-configured clients. Unlike
C<RandomizedDelaySec>, this setting applies its offset with no regard to manager
startup time. This maintains the periodicity of configured C<OnCalendar> events
across manager restarts.

For example, let\'s say you\'re running a backup service and have a fleet of laptops that wish
to make backups weekly. To distribute load on the backup service, each laptop should randomly pick
a weekday to upload its backups. This could be achieved by setting C<OnCalendar> to
C<weekly>, and then configuring a C<RandomizedDelaySec> of
C<5 days> with C<FixedRandomDelay> enabled. Let\'s say that some
laptop randomly chooses a delay of 4 days. If this laptop is restarted more often than that, then the
timer will never fire: on each fresh boot, the 4 day delay is restarted and will not be finished by
the time of the next shutdown. Instead, you should use C<RandomizedOffsetSec>, which
will maintain the configured weekly cadence of timer events, even across reboots.',
      'RemainAfterElapse' => 'Takes a boolean argument. If true, a timer will stay loaded, and its state remains
queryable even after it elapsed and the associated unit (as configured with C<Unit>,
see above) deactivated again. If false, an elapsed timer unit that cannot elapse anymore is unloaded
once its associated unit deactivated again. Turning this off is particularly useful for transient

lib/Config/Model/models/Systemd/Section/Timer.pod  view on Meta::CPAN

elapsing time. This setting only has an effect on timers configured with C<OnCalendar>,
and it can be combined with C<RandomizedDelaySec>.

Much like C<RandomizedDelaySec>, this setting is for distributing timer events
to prevent them from firing all at once. However, this setting is most useful to prevent resource
congestion on a remote service, from a fleet of similarly-configured clients. Unlike
C<RandomizedDelaySec>, this setting applies its offset with no regard to manager
startup time. This maintains the periodicity of configured C<OnCalendar> events
across manager restarts.

For example, let's say you're running a backup service and have a fleet of laptops that wish
to make backups weekly. To distribute load on the backup service, each laptop should randomly pick
a weekday to upload its backups. This could be achieved by setting C<OnCalendar> to
C<weekly>, and then configuring a C<RandomizedDelaySec> of
C<5 days> with C<FixedRandomDelay> enabled. Let's say that some
laptop randomly chooses a delay of 4 days. If this laptop is restarted more often than that, then the
timer will never fire: on each fresh boot, the 4 day delay is restarted and will not be finished by
the time of the next shutdown. Instead, you should use C<RandomizedOffsetSec>, which
will maintain the configured weekly cadence of timer events, even across reboots. I< Optional. Type uniline.  > 

=head2 DeferReactivation

Takes a boolean argument. When enabled, the timer schedules the next elapse based on

t/model_tests.d/systemd-user-examples/duplicity/duplicity.service  view on Meta::CPAN

[Service]
ExecStart = my-backup

t/model_tests.d/systemd-user-examples/duplicity/duplicity.service~  view on Meta::CPAN

## This file was written by cme command.
## You can run 'cme edit systemd-user' to modify this file.
## You may also modify the content of this file with your favorite editor.


[Service]
ExecStart = /home/domi/private/admin/backup-ylum.sh

t/model_tests.d/systemd-user-test-conf.pl  view on Meta::CPAN

        backend_arg => 'test.service',
        load => 'service:test Unit Description="test from scratch"',
        file_contents_like => {
            "home/joe/.config/systemd/user/test.service" => qr/from scratch/ ,
        },
    },
    {
        name => 'duplicity',
        backend_arg => 'duplicity',
        check => [
            'service:duplicity Service ExecStart:0' => "my-backup",
            'timer:duplicity Timer OnCalendar:0' => '13:00',
            'timer:duplicity Unit Description'=>"Run duplicity",
        ]
    }
);

return {
    tests => \@tests,
    home_for_test=>'/home/joe',
    conf_dir => '~/.config/systemd/user/',



( run in 1.619 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )