From 2a5ec791514c22ba65e07e7f8b17e47232eed47b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 15 Feb 2024 17:15:08 +0100 Subject: [PATCH] Add cron stuff --- cron | 8 ++++++++ rebuild.sh | 1 + sourcesautoupdate.sh | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 cron create mode 100644 sourcesautoupdate.sh diff --git a/cron b/cron new file mode 100644 index 00000000..dc31c2d0 --- /dev/null +++ b/cron @@ -0,0 +1,8 @@ +# Every 4 hours +0 */4 * * * root /bin/bash __BASEDIR__/rebuild.sh + +# Everyday at 20:30 +30 20 * * * root /bin/bash __BASEDIR__/sourcesautoupdate.sh + +# Every friday at 6pm +0 17 * * 5 root /usr/bin/python3 __BASEDIR__/tools/update_app_levels/update_app_levels.py diff --git a/rebuild.sh b/rebuild.sh index 3dc9b232..a048fd94 100644 --- a/rebuild.sh +++ b/rebuild.sh @@ -6,5 +6,6 @@ log=$workdir/app_list_auto_update.log cd $workdir date >> $log git pull &>/dev/null +cat cron | sed "s@__BASEDIR__@$workdir@g" > /etc/cron.d/app_list ./tools/list_builder.py &>> $log || sendxmpppy "[listbuilder] Rebuilding the application list failed miserably" diff --git a/sourcesautoupdate.sh b/sourcesautoupdate.sh new file mode 100644 index 00000000..2c3db187 --- /dev/null +++ b/sourcesautoupdate.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +workdir=$(dirname "$0") +log=$workdir/app_sources_auto_update.log + +cd $workdir +date >> $log +git pull &>/dev/null +cat cron | sed "s@__BASEDIR__@$workdir@g" > /etc/cron.d/app_list + +python3 tools/autoupdate_app_sources/autoupdate_app_sources.py --commit-and-create-PR &> $log || sendxmpppy "[appsourcesautoupdate] App sources auto-update failed miserably"