Browse Source

Fix cron and maintenance jobs

pull/253/head
Jimmy Monin 6 years ago
parent
commit
4e12728808
  1. 2
      conf/nextcloud.cron
  2. 1
      scripts/install
  3. 1
      scripts/upgrade
  4. 2
      scripts/upgrade.d/upgrade.last.sh

2
conf/nextcloud.cron

@ -1 +1 @@
*/15 * * * * __USER__ /usr/bin/php -f __DESTDIR__/cron.php
*/15 * * * * __USER__ /usr/bin/php__YNH_PHP_VERSION__ -f __DESTDIR__/cron.php

1
scripts/install

@ -268,6 +268,7 @@ chmod 644 "$cron_path"
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path"
ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path"
ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path"
exec_occ background:cron

1
scripts/upgrade

@ -383,6 +383,7 @@ chmod 644 "$cron_path"
ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$cron_path"
ynh_replace_string --match_string="__DESTDIR__" --replace_string="$final_path" --target_file="$cron_path"
ynh_replace_string --match_string="__YNH_PHP_VERSION__" --replace_string="$YNH_PHP_VERSION" --target_file="$cron_path"
exec_occ background:cron

2
scripts/upgrade.d/upgrade.last.sh

@ -12,5 +12,5 @@ last_upgrade_operations () {
cp -a ../sources/patches_last_version/* ../sources/patches
# Execute post-upgrade operations later on
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php occ db:add-missing-indices ; sudo -u $app php occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
}
Loading…
Cancel
Save