mail-postfix.sh: add recursive copy of db files

This commit is contained in:
Jeff Volkenant 2021-12-23 11:20:52 -08:00 committed by jeff
parent ffb4e7ad8e
commit 9288f0cd90
1 changed files with 4 additions and 2 deletions

View File

@ -252,8 +252,10 @@ mkdir -p $STORAGE_ROOT/mail/postgrey
if [ ! "$(ls -A $STORAGE_ROOT/mail/postgrey)" ]; then
# Stop the service
service postgrey stop
# Copy over the databse, we didn't cp -p to preserve perms since we have to chown the newly created directory above anyway
cp /var/lib/postgrey/* $STORAGE_ROOT/mail/postgrey/
# Copy over the databse.
# We didn't cp -p to preserve perms since we have to chown the newly created directory above anyway.
# There really shouldn't be any folders in this path, but if there are for any reason cp fails without -r (recursive).
cp -r /var/lib/postgrey/* $STORAGE_ROOT/mail/postgrey/
fi
# Fix permissions
chown -R postgrey:postgrey $STORAGE_ROOT/mail/postgrey/