Cod. Ultima revisione Wiki Note
966 2024/07/10 - MM Documentation - #12

Backup Procedure

The backup procedure for Hosted Wallet OnPremises (HWOP) ensures reliable preservation of critical data and allows for quick recovery in case of data loss, corruption, or system failures.

Script Usage Instructions

Environment Variables

The backup script uses several environment variables which must be defined in a .env file located in the backup directory.
Variable Meaning
DB_CONTAINER_BACKEND Name of the Docker container running the backend database.
DB_USER_BACKEND Username for the backend database.
DB_NAME_BACKEND Name of the backend database.
DB_CONTAINER_KEYCLOAK Name of the Docker container running the Keycloak database.
DB_USER_KEYCLOAK Username for the Keycloak database.
DB_NAME_KEYCLOAK Name of the Keycloak database.
BACKUP_DIR Directory where backups will be stored. By default, it uses the current user's home directory.
HWP_DIR Directory where the Hosted Wallet OnPremises infrastructure is located.
BACKUP_RETENTION_DAYS Number of days to retain backup files before they are deleted.

Running the Script

  1. Navigate to the directory where backup_script.sh is located:
  2. cd /path/to/infrastructure/backup_script/
    Replace /path/to/infrastructure/ with the path where your Hosted Wallet OnPremises is located
  3. Make the script executable:
  4. chmod +x backup_script.sh
  5. To run the script manually:
  6. ./backup_script.sh
  7. To schedule the script with a cron job:
    • Open the crontab editor:
      crontab -e
    • Add a new cron job:
      0 9 * * * /path/to/backup_script/backup_script.sh > /path/to/backup_script/log/script.log 2>/path/to/backup_script/log/script_error.log
      The cron job above schedules the execution of the backup script everyday at 9.00 am and manages its output and error logs. Update it according to your environment
  8. Ensure to transfer the timestamped backup file from the server to a secure location after each backup.

Argomenti correlati

  • Recovery HWOP Documentation -