Skip to content

Commit

Permalink
update dump procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
compgeniuses committed Feb 8, 2025
1 parent 673999e commit c539ae3
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions imageroot/bin/module-dump-state
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,6 @@ BACKUP_FILE="backup_paths.txt"
BASE_DIR="/home/frappe/frappe-bench/sites/"

backup_and_save_paths() {
<<<<<<< HEAD
local site=$1
local output

echo "Listing apps"
podman exec backend bench list-apps
podman exec frontend bench list-apps
echo "Running this command"
echo "Running backup for site: $site"
output=$(podman exec backend bench --site "$site" backup --with-files 2>&1)
echo "Raw backup output: $output"

if [[ $? -ne 0 ]]; then
echo "Error during backup: $output"
exit 1
fi

echo "Backup output received."

# Use grep without lookbehind assertions
local config_path=$(echo "$output" | grep -o "Config\s*:\s*.*" | awk '{print $2}')
local db_path=$(echo "$output" | grep -o "Database:\s*.*" | awk '{print $2}')
local public_archive=$(echo "$output" | grep -o "Public\s*:\s*.*" | awk '{print $2}')
local private_archive=$(echo "$output" | grep -o "Private\s*:\s*.*" | awk '{print $2}')

# Validate that paths were extracted correctly
if [[ -z "$config_path" || -z "$db_path" || -z "$public_archive" || -z "$private_archive" ]]; then
echo "Error extracting backup paths."
exit 1
fi

# Save the paths to the backup file
{
echo "CONFIG_PATH=${BASE_DIR}${config_path}"
echo "DB_PATH=${BASE_DIR}${db_path}"
echo "PUBLIC_ARCHIVE=${BASE_DIR}${public_archive}"
echo "PRIVATE_ARCHIVE=${BASE_DIR}${private_archive}"
} >"$BACKUP_FILE"

echo "Backup paths saved to $BACKUP_FILE"
}
=======
local site=$1
local output

Expand Down Expand Up @@ -102,4 +60,3 @@ backup_and_save_paths() {
echo "Starting Backup..."
backup_and_save_paths "$SITE"
echo "Backup finished."
>>>>>>> 47481e8f7811de507ae6abf4a39a62a98b19be0b

0 comments on commit c539ae3

Please sign in to comment.