BernieO / calcardbackup

calcardbackup: moved to https://codeberg.org/BernieO/calcardbackup
GNU Affero General Public License v3.0
69 stars 5 forks source link

Support multiple instances installation #9

Closed didierm closed 6 years ago

didierm commented 6 years ago

We run multiple instances with the same codebase, by using the NEXTCLOUD_CONFIG_DIR variable (https://github.com/nextcloud/server/issues/300).

In order for calcardbackup to support multiple instances, I propose the following patch :

# location of ownClouds/Nextclouds config.php:
configphp="${nextcloud_path}/config/config.php"

to

# location of ownClouds/Nextclouds config.php:
[[ -z "${NEXTCLOUD_CONFIG_DIR:-}" ]] && configphp="${nextcloud_path}/config/config.php" || configphp="${NEXTCLOUD_CONFIG_DIR}/config.php"
BernieO commented 6 years ago

On a first glance this looks good to me. I will have a closer look into this the next couple of days.

BernieO commented 6 years ago

I saw that this is also possible with ownCloud: https://github.com/owncloud/core/pull/27874

support for environment variables NEXTCLOUD_CONFIG_DIR and OWNCLOUD_CONFIG_DIR is been added with commit https://github.com/BernieO/calcardbackup/commit/279b9232ac2d428f23dc72a4e82f9e2415c32729 (until release of the next version only in the testing branch)

However, if both environment variables are set, calcardbackup will exit with an error, because the script does not know which one to use. In this case one of the environment variables has to be unset for the script to work.

@didierm: could you check whether that does the trick for your use case? Thanks.

didierm commented 6 years ago

Tested (ver. 0.7.2-24 (13.10.2018)) with NEXTCLOUD_CONFIG_DIR ; works perfect. Thanks a lot !