ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Tags
    3. systemd timers
    Log in to post
    • All categories
    • JaredBusch

      Use a script and systemd timer to keep the FreePBX tftpboot directory up to date with a git repository
      IT Discussion • freepbx config file git scripting systemd systemd timers • • JaredBusch

      1
      3
      Votes
      1
      Posts
      195
      Views

      No one has replied

    • Obsolesce

      Converting a cron job to a systemd timer
      IT Discussion • systemd timers crontab saltstack • • Obsolesce

      5
      3
      Votes
      5
      Posts
      1089
      Views

      AdamF

      @Obsolesce said in Converting a cron job to a systemd timer:

      First some info as it may have impact on whether or not to do this in the first place:

      I have a SaltStack deployment of 600-ish minions. Currently, I have a highstate set to run every 45 minutes via cron:

      */45 * * * * root /usr/bin/salt -b 25\% '*' state.apply

      I know one of the benefits of systemd over cron is the logging, and I think this would be great to have better logging of when this runs. More can potentially be done with it automatically, like look for issues and send emails just as one easy example.

      But I don't know how to test this... maybe it doesn't produce the kind of log I want, and salt may already do this in it's own log even better. Or maybe this will produce a log that's too big and cause issues later. I can watch it in the beginning either way, so it's fine.

      Can that cron job be converted into a reliable systemd timer? If so, how?

      600ish minions. Wow. Curious about your setup. (Types of systems, types of states, how to manage and review output of all of that, etc.” Maybe an upcoming post? 🙂

    • wirestyle22

      mailto alternative for systemd timers
      IT Discussion • systemd timers • • wirestyle22

      8
      0
      Votes
      8
      Posts
      558
      Views

      stacksofplates

      @jaredbusch said in mailto alternative for systemd timers:

      I would recommend writing the script to take parameters. Because then it is generic and you can plug it in on every system as part of the system setup process.
      https://tecadmin.net/pass-command-line-arguments-in-shell-script/

      Here's a template that I loosely follow for this:

      #!/bin/bash #Script functions function script_help () { echo " Usage: $(basename $0) [options] -a word -a Echos the word you type -h this help text Example: $(basename $0) "-a word exit ${1:-0} } function thing () { echo $variable } #Show help if no arguments or options are passed [[ ! "$*" ]] && script_help 1 OPTIND=1 #Read command line options # A colon after a flag means it takes an argument while getopts "a:ih" opt; do case "$opt" in a) variable=$OPTARG ;; h) script_help ;; \?) script_help 1 ;; esac done shift $(($OPTIND-1)); #Run argument function thing

      In this case, it calls the thing function on the argument from the -a flag and also has a help function.

    • wirestyle22

      Renewing Let's Encrypt certificates using a systemd timer
      IT Discussion • systemd timers certbot nginx how to • • wirestyle22

      9
      7
      Votes
      9
      Posts
      1318
      Views

      JaredBusch

      @wirestyle22 said in Renewing Let's Encrypt certificates using a systemd timer:

      sudo systemctl enable certbot-renewal.timer

      As I did this again today, I thought I would post my quick tweak to this because I do not like the idea of it running hourly.

      I set mine to run twice a day with a 1 hour randomizer.

      [Timer] OnCalendar=*-*-* 01,13:00:00 RandomizedDelaySec=3600 Unit=certbot-renewal.service

      027a0074-88ec-4c1f-b114-91722521529b-image.png

    • JaredBusch

      How to use a systemd timer instead of cron to automate a git pull
      IT Discussion • systemd timer cron fedora rhel git pull git systemd timers • • JaredBusch

      13
      6
      Votes
      13
      Posts
      1888
      Views

      stacksofplates

      @jaredbusch said in How to use a systemd timer instead of cron to automate a git pull:

      Oh look I just found this posted here already /sigh..

      So many questions I could have not asked of @stacksofplates, had I recalled this thread.
      https://mangolassi.it/topic/13455/systemd-timers-instead-of-cron

      I honestly forgot I posted that.

    • JaredBusch

      Using dnf-automatic to keep Fedora up to date
      IT Discussion • fedora dnf updates dnf-automatic fedora 26 systemd systemd timers • • JaredBusch

      36
      10
      Votes
      36
      Posts
      2951
      Views

      FATeknollogee

      @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

      @FATeknollogee said in Using dnf-automatic to keep Fedora up to date:

      There really need to be a setting for this in the Workstation GUI.

      By default Fedora Workstation + Cinnamon uses dnfdragora which is a totally separate process.

      Yes, I realize that.
      This setting exists in Cockpit, no reason why it can't be in WS!

    • stacksofplates

      Systemd timers instead of cron
      IT Discussion • cron linux unix systemd systemd timers • • stacksofplates

      3
      4
      Votes
      3
      Posts
      3238
      Views

      stacksofplates

      @obsolesce said in Systemd timers instead of cron:

      @stacksofplates said in Systemd timers instead of cron:

      Now just enable each one
      systemctl enable backup-tower backup-pbx backup.target backup.timer

      I'm not sure how this works.
      Why wouldn't you just enable the backup.timer? Why add everything else in there?
      I'm not clear on how it's all linked.

      Yeah you don't. I honestly don't remember why I had it this way. Could have just been an accident. Was quite a while ago.