From 4d3e042a168beaec1f160315fb8e993b9421667a Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Tue, 20 Aug 2019 19:12:08 +0200 Subject: [PATCH] Add cronjob to update pacman mirror list Resolves #10 Signed-off-by: Severin Kaderli --- install | 1 + system/etc/cron.daily/update-mirror | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 system/etc/cron.daily/update-mirror diff --git a/install b/install index 3cbbaa4..9c66817 100755 --- a/install +++ b/install @@ -164,6 +164,7 @@ CHROMIUM_EXTENSIONS=( # Root files which should be copied declare -A COPY_ROOT_FILES COPY_ROOT_FILES=( + ["/etc/cron.daily/update-mirror"]="755" ["/etc/docker/daemon.json"]="644" ["/etc/gemrc"]="644" ["/etc/logrotate.d/custom.conf"]="644" diff --git a/system/etc/cron.daily/update-mirror b/system/etc/cron.daily/update-mirror new file mode 100644 index 0000000..0dd0bce --- /dev/null +++ b/system/etc/cron.daily/update-mirror @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# SCRIPT NAME: +# update-mirror +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# Updates pacman mirror list using reflector +# +# USAGE: +# ./update-mirror +. /home/severin/.local/bin/utils + +{ + print_time_log "update-mirror" "Update pacman mirror list" + reflector --country Switzerland --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist +} >> /home/severin/.local/log/cron.log 2>&1 \ No newline at end of file