+ import prod to local database script with ssh native compression

+ lighten restore perms script because on small count of files - that is better speed
This commit is contained in:
2024-06-18 09:24:24 +03:00
parent 0b25140481
commit e5f35243e4
3 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,31 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WP_CONTENT_DIRS=(
plugins
upgrade
uploads
themes
)
export WEB_GID=33
perms() {
sudo chown -R $UID:$WEB_GID "$1"
sudo chmod -R g+rwx "$1"
}
permsFile() {
sudo chown $UID:$WEB_GID "$1"
sudo chmod g+rw "$1"
}
for DIR in "${WP_CONTENT_DIRS[@]}"; do
DIR="$SCRIPT_DIR/../wp-content/$DIR"
if [[ -f $DIR ]]; then
permsFile "$DIR"
else
perms "$DIR"
fi
done