From d934a9192db4b9504d0364d99147ed8eef38eed9 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Mon, 7 Jan 2019 07:30:42 +0100 Subject: [PATCH 1/2] Maintenance operations: fix user for multi-instance and apply at installation --- scripts/install | 5 +++++ scripts/upgrade.d/upgrade.last.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7173e1d..246f6ea 100755 --- a/scripts/install +++ b/scripts/install @@ -236,6 +236,11 @@ ynh_replace_string "#DESTDIR#" "$final_path" "$cron_path" exec_occ background:cron +#================================================= +# POST-INSTALL MAINTENANCE +#================================================= +(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/nextcloud_maintenance.log") + #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE #================================================= diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index e061d31..0d0d7a2 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/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 nextcloud php occ db:add-missing-indices ; sudo -u nextcloud php occ db:convert-filecache-bigint -n) > /tmp/nextcloud_maintenance.log") + (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/nextcloud_maintenance.log") } From 8e75ccbee95e7d78194ca20529bc351db492b5a8 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 27 Jan 2019 08:58:18 +0100 Subject: [PATCH 2/2] Use one log file per nextcloud instance --- scripts/install | 2 +- scripts/upgrade.d/upgrade.last.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 246f6ea..5bc37bf 100755 --- a/scripts/install +++ b/scripts/install @@ -239,7 +239,7 @@ exec_occ background:cron #================================================= # POST-INSTALL MAINTENANCE #================================================= -(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/nextcloud_maintenance.log") +(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") #================================================= # CONFIGURE THE HOOK FILE FOR USER CREATE diff --git a/scripts/upgrade.d/upgrade.last.sh b/scripts/upgrade.d/upgrade.last.sh index 0d0d7a2..2e16813 100755 --- a/scripts/upgrade.d/upgrade.last.sh +++ b/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/nextcloud_maintenance.log") + (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") }