Ignore:
Timestamp:
10/22/2017 08:57:13 PM (5 years ago)
Author:
DJ Lucas <dj@…>
Branches:
10.0, 10.1, 11.0, 11.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, lazarus, perl-modules, qt5new, trunk, upgradedb, xry111/intltool, xry111/test-20220226
Children:
df9499b
Parents:
ad4043e2
Message:

Use timers in systemd where appropriate, not crontab.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19359 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • general/sysutils/usbutils.xml

    rad4043e2 rac8c7d4  
    143143    <title>Configuring USB Utils</title>
    144144
    145     <para>
     145    <para revision="sysv">
    146146      The <filename>usb.ids</filename> data file is constantly being updated.
    147147      To get a current version of this file, using <xref linkend="wget"/>,
     
    150150    </para>
    151151
    152 <screen role="root"><userinput>wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</userinput></screen>
    153 
    154     <para>
     152<screen role="root" revision="sysv"><userinput>wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</userinput></screen>
     153
     154    <para revision="sysv">
    155155      You may wish to add an entry to
    156156      <systemitem class="username">root</systemitem>'s (or any other user who has
     
    159159      periodically.
    160160    </para>
     161
     162    <para revision="systemd">
     163      You should update the <filename>/usr/share/hwdata/usb.ids</filename> file
     164      periodically. Execute the following commands, as the
     165      <systemitem class="username">root</systemitem> user, to create a systemd
     166      timer to update it weekly on Sundays at 3:00 A.M. (local time):
     167    </para>
     168
     169<screen role="root" revision="systemd"><userinput>cat &gt; /lib/systemd/system/update-usbids.service &lt;&lt; "EOF" &amp;&amp;
     170<literal>[Unit]
     171Description=Update usb.ids file
     172Documentation=man:lusub(8)
     173DefaultDependencies=no
     174After=local-fs.target
     175Before=shutdown.target
     176
     177[Service]
     178Type=oneshot
     179RemainAfterExit=yes
     180ExecStart=/usr/bin/wget http://www.linux-usb.org/usb.ids -O /usr/share/hwdata/usb.ids</literal>
     181EOF
     182cat &gt; /lib/systemd/system/update-usbids.timer &lt;&lt; "EOF" &amp;&amp;
     183<literal>[Unit]
     184Description=Update usb.ids file weekly
     185
     186[Timer]
     187OnCalendar=Sun 03:00:00
     188Persistent=true
     189
     190[Install]
     191WantedBy=timers.target</literal>
     192EOF
     193systemctl enable update-usbids.timer</userinput></screen>
    161194
    162195  </sect2>
Note: See TracChangeset for help on using the changeset viewer.