1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

Add cron stuff

This commit is contained in:
Alexandre Aubin 2024-02-15 17:15:08 +01:00
parent c98cd372be
commit 2a5ec79151
3 changed files with 20 additions and 0 deletions

8
cron Normal file
View file

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

View file

@ -6,5 +6,6 @@ log=$workdir/app_list_auto_update.log
cd $workdir cd $workdir
date >> $log date >> $log
git pull &>/dev/null 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" ./tools/list_builder.py &>> $log || sendxmpppy "[listbuilder] Rebuilding the application list failed miserably"

11
sourcesautoupdate.sh Normal file
View file

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