<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="moz-cite-prefix">On 10/01/2018 05:17, Andrei Borzenkov
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:a79b2194-86ce-e417-c4c5-68d1730e251c@gmail.com">
      <pre wrap="">09.01.2018 22:28, Joerg Diederich пишет:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hello,

I have a little (perhaps strange) requirement:
I want to execute a script about five minutes after system boot, but only on specific weekdays (e. g. Sundays) using systemd.timer. I tried a combination of OnBootSec and OnCalendar like

OnBootSec=5m
OnCalendar=Sun

but this doesn't work.
</pre>
      </blockquote>
      <pre wrap="">
Well, it works but not they way you want it :) As documented, multiple
directives are additive - timer will trigger when any of them elapses.
May be it could be expressed more obviously.
</pre>
    </blockquote>
    <br>
    There is a workaround but it's a bit more complicated than it should
    be : use multiple timers.<br>
    <br>
    timer1.timer ; OnBootSec=5m<br>
    timer1.service ; Wants=timer2<br>
    <br>
    timer2.timer ; Oncalendar=Sun<br>
    <br>
    <br>
    Note that you need the intermediate unit, you cant user
    Unit=timer2.timer in timer1.timer because a timer is not allowed to
    start another time (I don't know why)<br>
    <br>
    You can also have a look at
    <a class="moz-txt-link-freetext" href="https://github.com/systemd/systemd/pull/7023">https://github.com/systemd/systemd/pull/7023</a> where II suggested
    something similar for upstream<br>
    <br>
    Cheers<br>
    Jérémy<br>
    <br>
    <br>
    <blockquote type="cite"
      cite="mid:a79b2194-86ce-e417-c4c5-68d1730e251c@gmail.com">
      <pre wrap="">
</pre>
      <blockquote type="cite">
        <pre wrap="">My script executes always after boot. I'm running systemd-228-38.1.x86_64 on SuSE LEAP 42.3. Of course, I can modify my script to ask for the current weekday, but I thought, it would be more elegant to configure it all together in the timer unit file.
</pre>
      </blockquote>
      <pre wrap="">
This would likely require new directive or at least new syntax. Timers
define point in time, not period of time.
_______________________________________________
systemd-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <div>
        <link href="https://fonts.googleapis.com/css?family=Raleway"
          rel="stylesheet" type="text/css">
        <font face="Raleway, regular">
          <table style="padding:20px;margin-bottom:-10px" border="0">
            <tbody>
              <tr>
                <td style="font-size:13px; color:#ff8054; text-align:
                  center; padding-right:30px"> <a
                    href="http://www.smile.eu/"> <img
                      style="max-width:100%; height:auto"
src="http://ftp.smile.fr/client/Communication/signature/img/Logo-new.png"
                      alt="SMILE"> </a><br>
                  <br>
                  <p style="line-heigth:8px">20 rue des Jardins<br>
                    92600 Asnières-sur-Seine</p>
                </td>
                <td style="border-left: 1px solid #3b7ffe;
                  padding-left:20px; font-size:13px; color:#ff8054;">
                  <div style="color:#ff8054; font-size:14px;"> <b>Jérémy
                      ROSEN</b> </div>
                  <div style="color:#3b7ffe; font-size:13px;">
                    Architecte technique<br>
                    Responsable de l'expertise Smile-ECS </div>
                  <br>
                  <div style="color:#3b7ffe; font-size:13px;"> <span
                      style="white-space: nowrap"><img
                        style="margin-right:5px"
                        src="http://ftp.smile.fr/client/Communication/signature/img/mail.png"
                        alt="email" width="12" height="10"> <a
                        href="mailto:jeremy.rosen@smile.fr"
                        style="color:#3b7ffe; font-size:13px;
                        text-decoration:none;">jeremy.rosen@smile.fr</a>
                    </span> <br>
                    <span style="white-space: nowrap"><img
                        style="margin-right:5px"
                        src="http://ftp.smile.fr/client/Communication/signature/img/phone.png"
                        alt="phone" width="10" height="10"></span>
                    +33141402967 <br>
                    <span style="white-space: nowrap"><img
                        style="margin-right:5px"
                        src="http://ftp.smile.fr/client/Communication/signature/img/web.png"
                        alt="url" width="12" height="12">
                      <a href="http://www.smile.eu"
                        style="color:#3b7ffe; font-size:13px;
                        text-decoration:none;">http://www.smile.eu</a> </span>
                  </div>
                  <br>
                  <div> <span><a style="margin-right:5px"
                        href="https://twitter.com/GroupeSmile"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-twitter.png"
                          alt="Twitter" style="max-width:100%;
                          height:auto"></a></span> <span><a
                        style="margin-right:5px"
                        href="https://www.facebook.com/smileopensource"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-facebook.png"
                          alt="Facebook" style="max-width:100%;
                          height:auto"></a></span> <span><a
                        style="margin-right:5px"
                        href="https://www.linkedin.com/company/smile"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-linkedin.png"
                          alt="LinkedIn" style="max-width:100%;
                          height:auto"></a></span> <span><a
                        style="margin-right:5px"
                        href="https://github.com/Smile-SA"><img
src="http://ftp.smile.fr/client/Communication/signature/img/rs-github.png"
                          alt="Github" style="max-width:100%;
                          height:auto"></a></span> </div>
                </td>
              </tr>
            </tbody>
          </table>
          <br>
          <div> <a
href="http://smile.eu/?utm_source=signature&utm_medium=email&utm_campaign=signature"><img
src="http://signature.smile.eu/assets/img/bandeau_mail_smile2017.gif.gif"
                alt="Découvrez l’univers Smile, rendez-vous sur
                smile.eu" border="0"></a></div>
          <br>
          <div style="color:#a3acb5; font-size:10px;"> <img
              src="http://ftp.smile.fr/client/Communication/signature/img/eco.png"
              alt="eco" width="13" height="11"> Pour la planète,
            n'imprimez ce mail que si c'est nécessaire </div>
        </font>
      </div>
    </div>
  </body>
</html>