Merge pull request #189 from haiwen/seafile-logs-nginx-conf-2

mv seafile/logs to /shared/seafile/logs & persistence nginx config file.
This commit is contained in:
Hulk 2019-11-19 12:11:27 +08:00 committed by GitHub
commit 50829d07a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -194,7 +194,7 @@ COMPRESS_CACHE_BACKEND = 'locmem'""")
# container, we need to move them to the shared volume # container, we need to move them to the shared volume
# #
# e.g move "/opt/seafile/seafile-data" to "/shared/seafile/seafile-data" # 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: for fn in files_to_copy:
src = join(topdir, fn) src = join(topdir, fn)
dst = join(shared_seafiledir, fn) dst = join(shared_seafiledir, fn)

View file

@ -18,17 +18,12 @@ if [[ $TIME_ZONE != "" ]]; then
fi fi
fi fi
if [[ -e /shared/logs/seafile ]]; then
mv /shared/logs/seafile /shared/seafile/logs
fi
dirs=( dirs=(
conf conf
ccnet ccnet
seafile-data seafile-data
seahub-data seahub-data
pro-data pro-data
logs
seafile-license.txt seafile-license.txt
) )
@ -39,8 +34,15 @@ for d in ${dirs[*]}; do
fi fi
done 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 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 fi
rm -rf /var/log && ln -sf /shared/logs/var-log /var/log rm -rf /var/log && ln -sf /shared/logs/var-log /var/log