mirror of
https://github.com/nextcloud/docker.git
synced 2024-11-18 02:56:42 +01:00
Do not overwrite existing data when creating initial directories.
Signed-off-by: Patrick Mansfield <patmans@yahoo.com> Issue 1925
This commit is contained in:
parent
7bd3b7b6db
commit
dd242f1f70
10 changed files with 70 additions and 0 deletions
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
|
@ -171,6 +171,13 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
||||||
rsync_options="-rlD"
|
rsync_options="-rlD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$installed_version" = "0.0.0.0" ]; then
|
||||||
|
if [ -n "$(ls -1 -A /var/www/html | grep -v -w "nextcloud-init-sync.lock")" ]; then
|
||||||
|
echo "New instance and /var/www/html is not empty, refusing to overwrite existing files."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
|
||||||
for dir in config data custom_apps themes; do
|
for dir in config data custom_apps themes; do
|
||||||
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
|
||||||
|
|
Loading…
Reference in a new issue