Cod. | Ultima revisione | Wiki | Note |
---|---|---|---|
966 | 2024/07/10 - MM | Documentation - #12 |
Backup HWOP Documentation
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
- Navigate to the directory where
backup_script.sh
is located: - Make the script executable:
- To run the script manually:
- 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 - Ensure to transfer the timestamped backup file from the server to a secure location after each backup.
cd /path/to/infrastructure/backup_script/Replace
/path/to/infrastructure/
with the path where your Hosted Wallet OnPremises is located
chmod +x backup_script.sh
./backup_script.sh