From b86c3e34b01ab1570b588c2170a63f250d18ae8e Mon Sep 17 00:00:00 2001 From: Alban Vidal Date: Fri, 23 Oct 2020 19:29:47 +0200 Subject: [PATCH] Ajout service et timer git-auto-pull --- conf/etc/systemd/system/git-auto-pull.service | 15 +++++++++++++++ conf/etc/systemd/system/git-auto-pull.timer | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 conf/etc/systemd/system/git-auto-pull.service create mode 100644 conf/etc/systemd/system/git-auto-pull.timer diff --git a/conf/etc/systemd/system/git-auto-pull.service b/conf/etc/systemd/system/git-auto-pull.service new file mode 100644 index 0000000..89ee9ce --- /dev/null +++ b/conf/etc/systemd/system/git-auto-pull.service @@ -0,0 +1,15 @@ +################################################################################ +# Dépôt Git : +# https://framagit.org/zorval/scripts/check-nrpe +################################################################################ + +[Unit] +Description=Auto pull git repositories +After=network.target network-online.target systemd-networkd.service NetworkManager.service + +[Service] +Type=oneshot +ExecStart=/usr/local/sbin/git_auto_pull +# RemainAfterExit=true => si ce paramètre est à true, +# alors le service n'est plus lancé régulièrement par le timer +# => Il faut le laisser à false (valeur par défaut) diff --git a/conf/etc/systemd/system/git-auto-pull.timer b/conf/etc/systemd/system/git-auto-pull.timer new file mode 100644 index 0000000..32963e5 --- /dev/null +++ b/conf/etc/systemd/system/git-auto-pull.timer @@ -0,0 +1,16 @@ +################################################################################ +# Dépôt Git : +# https://framagit.org/zorval/scripts/check-nrpe +################################################################################ + +[Unit] +Description=Auto pull git repositories + +[Timer] +OnBootSec=1m +OnCalendar=*-*-* 07,19:00:00 +RandomizedDelaySec=1h +Persistent=true + +[Install] +WantedBy=timers.target