From 55930f285944b58741f2574ed55f7aebb967cefc Mon Sep 17 00:00:00 2001 From: root Date: Tue, 19 Nov 2019 12:09:21 +0800 Subject: [PATCH] mv seafile/logs to /shared/seafile/logs & persistence nginx config file. --- scripts/bootstrap.py | 2 +- scripts/create_data_links.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/bootstrap.py b/scripts/bootstrap.py index 7bfeda3..4231ec6 100755 --- a/scripts/bootstrap.py +++ b/scripts/bootstrap.py @@ -194,7 +194,7 @@ COMPRESS_CACHE_BACKEND = 'locmem'""") # container, we need to move them to the shared volume # # e.g move "/opt/seafile/seafile-data" to "/shared/seafile/seafile-data" - files_to_copy = ['conf', 'ccnet', 'seafile-data', 'seahub-data', 'pro-data', 'logs'] + files_to_copy = ['conf', 'ccnet', 'seafile-data', 'seahub-data', 'pro-data'] for fn in files_to_copy: src = join(topdir, fn) dst = join(shared_seafiledir, fn) diff --git a/scripts/create_data_links.sh b/scripts/create_data_links.sh index 8c6d5a4..d07f532 100755 --- a/scripts/create_data_links.sh +++ b/scripts/create_data_links.sh @@ -18,17 +18,12 @@ if [[ $TIME_ZONE != "" ]]; then fi fi -if [[ -e /shared/logs/seafile ]]; then - mv /shared/logs/seafile /shared/seafile/logs -fi - dirs=( conf ccnet seafile-data seahub-data pro-data - logs seafile-license.txt ) @@ -39,8 +34,15 @@ for d in ${dirs[*]}; do fi done +if [[ -e /shared/logs/seafile ]]; then + mv /shared/logs/seafile /shared/seafile/logs + rm -rf /opt/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ +else + mkdir -p /shared/seafile/logs && ln -sf /shared/seafile/logs /opt/seafile/ +fi + if [[ ! -e /shared/logs/var-log ]]; then - mv /var/log /shared/logs/var-log + mkdir -p /shared/logs/ && mv /var/log /shared/logs/var-log fi rm -rf /var/log && ln -sf /shared/logs/var-log /var/log