mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
Cronjobs & daily update script
This commit is contained in:
parent
3f798c071d
commit
8a1cee9523
3 changed files with 17 additions and 1 deletions
|
@ -1,2 +1,4 @@
|
|||
# Run poller periodically to update your website
|
||||
*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ -f Code/Daemon/Run.php Cron > /dev/null 2>&1
|
||||
# Daily software update job
|
||||
30 05 * * * __APP__ /bin/bash __DATA_DIR__/daily-update.sh >> __DATA_DIR__/daily-updates.log 2>&1
|
12
conf/daily-update.sh
Normal file
12
conf/daily-update.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
echo " "
|
||||
echo "+++ $(date) +++"
|
||||
echo " "
|
||||
echo "$(date) - db size."
|
||||
du -h /var/lib/mysql/__APP__
|
||||
#
|
||||
cd /var/www/__APP__
|
||||
/usr/bin/php__PHPVERSION__ util/udall
|
||||
echo "$(date) - Daily update finished."
|
||||
|
|
@ -110,9 +110,11 @@ chown $app:$app "$install_dir/.htconfig.php"
|
|||
ynh_script_progression --message="Setuping cron job..." --weight=1
|
||||
|
||||
# Set up cron job
|
||||
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
|
||||
ynh_add_config --template="../conf/cronjobs" --destination="/etc/cron.d/$app"
|
||||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
# Add daily update script
|
||||
ynh_add_config --template="../conf/daily-update.sh" --destination="/home/yunohost.app/$app/daily-update.sh"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
Loading…
Add table
Reference in a new issue