mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-04 00:17:06 +00:00
setup: tighten permissions to setup mods backup in user-data
This commit is contained in:
parent
e0a237c857
commit
f8bba1b2b8
@ -31,13 +31,16 @@ backup_mods() {
|
|||||||
if [ -d "$LOCAL_MODS_DIR" -a ! -z "$(ls -A "$LOCAL_MODS_DIR" 2>/dev/null)" ]; then
|
if [ -d "$LOCAL_MODS_DIR" -a ! -z "$(ls -A "$LOCAL_MODS_DIR" 2>/dev/null)" ]; then
|
||||||
local tmp="$dst.new"
|
local tmp="$dst.new"
|
||||||
mkdir -p "$(dirname "$dst")"
|
mkdir -p "$(dirname "$dst")"
|
||||||
|
chmod 750 "$(dirname "$dst")"
|
||||||
pushd "$LOCAL_MODS_DIR" >/dev/null
|
pushd "$LOCAL_MODS_DIR" >/dev/null
|
||||||
|
rm -f "$tmp"
|
||||||
tar czf "$tmp" \
|
tar czf "$tmp" \
|
||||||
--exclude-backups \
|
--exclude-backups \
|
||||||
--exclude-caches \
|
--exclude-caches \
|
||||||
--exclude=*/__pycache__/* \
|
--exclude=*/__pycache__/* \
|
||||||
--exclude=*/__pycache__ \
|
--exclude=*/__pycache__ \
|
||||||
*
|
*
|
||||||
|
chmod 640 "$tmp"
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
rm -f "$dst"
|
rm -f "$dst"
|
||||||
mv "$tmp" "$dst"
|
mv "$tmp" "$dst"
|
||||||
|
Loading…
Reference in New Issue
Block a user