File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -833,17 +833,14 @@ EOF
833833 # Add the necessary commands for full backups (append to file, note >>)
834834 cat << EOF >>"$script_path "
835835
836- # Get the wp installation folder owner and their home directory
836+ # Get the wp installation folder owner
837837wp_owner=\$ (sudo stat -c "%U" \$ {domain_path})
838- wp_owner_directory=\$ (sudo getent passwd \$ {wp_owner} | cut -d: -f6)
839838
840- # if we can't find the owner directory, use /tmp as fallback
841- if [ -z "\$ {wp_owner_directory}" ] || [ ! -d "\$ {wp_owner_directory}" ]; then
842- wp_owner_directory="/tmp"
843- fi
839+ # Use a dedicated temp directory for database backups
840+ wp_owner_directory="/tmp/wp_db_backup"
844841
845842echo "[\$ {timestamp}] - WP folder owner found: '\$ {wp_owner}'" >> "$LOG_FILE "
846- echo "[\$ {timestamp}] - WP folder owner home directory found : '\$ {wp_owner_directory}'" >> "$LOG_FILE "
843+ echo "[\$ {timestamp}] - Using temp directory: '\$ {wp_owner_directory}'" >> "$LOG_FILE "
847844
848845# Create tmp directory with proper permissions if it doesn't exist
849846if [ ! -d "\$ {wp_owner_directory}" ]; then
You can’t perform that action at this time.
0 commit comments