Skip to content

Commit 408b240

Browse files
committed
Beta upsun backups
1 parent a64816d commit 408b240

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

commands/host/upsun-command-center-bash

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ OPTIONS=(
3131
"6. Disk Allocation Helper (beta)"
3232
"7. Log-checker (beta)"
3333
"8. Log-checker with goaccess (beta)"
34+
"9. Backup Environment"
3435
)
3536

3637
# Get current project ID from .ddev/config.yaml
@@ -206,6 +207,16 @@ run_log_checker_goaccess() {
206207
goaccess --log-format=COMBINED -
207208
}
208209

210+
# Run backup
211+
run_backup() {
212+
local project_id="$1"
213+
local project_name="$2"
214+
local environment_id="$3"
215+
echo_green "${project_name} / ${environment_id} Selected"
216+
echo_yellow "Creating backup..."
217+
ddev exec upsun backup:create --project="${project_id}" -e "${environment_id}"
218+
}
219+
209220
# Main function
210221
main() {
211222
# Banner
@@ -303,6 +314,15 @@ main() {
303314
fi
304315
run_log_checker_goaccess "$project_id" "$project_name" "$env"
305316
;;
317+
"Backup Environment")
318+
local env
319+
env=$(select_environment "$project_id")
320+
if [[ -z "$env" ]]; then
321+
echo_red "No environment selected... Exiting"
322+
exit 0
323+
fi
324+
run_backup "$project_id" "$project_name" "$env"
325+
;;
306326
*)
307327
echo_red "Unknown action: $action_label"
308328
exit 1

0 commit comments

Comments
 (0)