ghettoVCB icon indicating copy to clipboard operation
ghettoVCB copied to clipboard

ghettoVCB-Express.sh - flexible backup/restore wrapper for single command backup & restore

Open itiligent opened this issue 4 months ago • 1 comments

PR Overview

This PR introduces ghettoVCB-Express.sh, a fast and user-friendly wrapper for ghettoVCB.sh and ghettoVCB-restore.sh scripts.

This wrapper script provides single command VM backup and recovery on ESXi via ghettoVCB.

Single command usability is achieved though automating the manual configuration tasks required by ghettoVCB, plus adding new flexibility via features such as:

  • Backup and restore of a cusomizable grouping of VMs from a single command
  • Support for an exclusion list of VMs to skip
  • Optional VM renaming prompts for each VM restoration task
  • Support for VMs with spaces in their names
  • Support for cancel and re-run without errors (cleans up old tmp files and orphan processes on each run.)

How It Works

  1. Just place the following files in the same directory:

    • ghettoVCB.conf (configure with your backup settings. Local or temporary NFS datastores remain supported)
    • ghettoVCB.sh
    • ghettoVCB-restore.sh
  2. Run the script with arguments below:

# Backup
./ghettoVCB-Express.sh --name vmname | "vm name"  # Back up a specific VM
./ghettoVCB-Express.sh --all                      # Back up all VMs except $EXCLUDED

# Restore
./ghettoVCB-Express --restore --name vmname       # Restore a specific VM, prompts to optionally rename
./ghettoVCB-Express.sh --restore --all            # Before executing restore, prompts to optionally:
                                                     # 1. Rename each VM auto discovered in the backup location
                                                     # 2. Customize the auto generated restore list   
# Dry Run
./ghettoVCB-Express.sh --dry-run --all            # Previews discovered VMs to be backed up
./ghettoVCB-Express.sh --restore --dry-run --all  # Previews discovered VMs to be restored

# Help
./ghettoVCB-Express.sh --help                     # Shows these usage options
  1. The script automatically selects the backup datastore path from ghettoVCB.conf

  2. If a non-persisten NFS backup datastore is configured in ghettoVCB.conf, this will be auto-mounted, and dismounted on comepletion for both backup or restore jobs..


About Backup Tasks

When run with --all or --name :

  • Backups will be executed with all ghettoVCB.conf options whilst also respecting exclusions in the EXCLUDE_VMS section of ghettoVCB-Express.sh

About Restore Tasks

When run with --restore --all or --restore --name :

  • A vm restore list is generated automatically

  • Before restore execution:

    • User is prompted to optionally rename each VM in the restore job.
    • User is then given the extra option to manually edit the vm restore list with vi before continuing.

itiligent avatar Aug 27 '25 04:08 itiligent