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

      Use a script and systemd timer to keep the FreePBX tftpboot directory up to date with a git repository

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion freepbx config file git scripting systemd systemd timers
      1
      3 Votes
      1 Posts
      601 Views
      No one has replied
    • ObsolesceO

      Converting a cron job to a systemd timer

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion systemd timers crontab saltstack
      5
      2 Votes
      5 Posts
      2k Views
      AdamFA

      @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? 🙂

    • wirestyle22W

      mailto alternative for systemd timers

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion systemd timers
      8
      0 Votes
      8 Posts
      1k Views
      stacksofplatesS

      @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.

    • wirestyle22W

      Renewing Let's Encrypt certificates using a systemd timer

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion systemd timers certbot nginx how to
      9
      7 Votes
      9 Posts
      2k Views
      JaredBuschJ

      @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

    • JaredBuschJ

      How to use a systemd timer instead of cron to automate a git pull

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion systemd timer cron fedora rhel git pull git systemd timers
      13
      6 Votes
      13 Posts
      3k Views
      stacksofplatesS

      @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.

    • JaredBuschJ

      Using dnf-automatic to keep Fedora up to date

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion fedora dnf updates dnf-automatic fedora 26 systemd systemd timers
      36
      10 Votes
      36 Posts
      6k Views
      FATeknollogeeF

      @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!

    • stacksofplatesS

      Systemd timers instead of cron

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion cron linux unix systemd systemd timers
      3
      4 Votes
      3 Posts
      5k Views
      stacksofplatesS

      @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.

    • 1 / 1