Skip to content

Informat Platform Backup Solution

This document describes how to back up core data of the Informat platform, including databases, shared storage files, and remote transfer of backup files.


I. Backup Database

The Informat platform uses PostgreSQL database. Regularly back up the following core databases:

shell
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_account_prd > /backup/db_informat2_account_prd_$(date +%F).sql
shell
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_biz_prd_0 > /backup/db_informat2_biz_prd_0_$(date +%F).sql

Reminder

✅ It is recommended to set up a scheduled task (cron) to execute daily with a date tag for easy tracing and recovery.

II. Transfer Backup Files to Remote Server

To improve data security, it is recommended to synchronize backup files to a remote server.

shell
scp /backup/*.sql user@192.168.1.100:/data/backup/

Please replace the following items with actual values:

  • user: Remote server username
  • 192.168.1.100: Remote server IP address
  • /data/backup/: Remote backup directory path

III. Backup Shared Storage Files (MinIO)

Uploaded files and other resources in Informat are stored in MinIO by default, and its data directory is /data/minio_home.

Local Backup Example:

bash
cp -r /data/minio_home /backup/minio_home_bak_$(date +%F)

IV. Automatic Backup Script and Scheduled Task Example

1. Backup Script Example /opt/scripts/backup_.sh

shell
#!/bin/bash

BACKUP_DIR="/backup"
DATE=$(date +%F)

# Database backup
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_account_prd > ${BACKUP_DIR}/db_informat2_account_prd_${DATE}.sql
/usr/local/pgsql/bin/pg_dump -U postgres db_informat2_biz_prd_0 > ${BACKUP_DIR}/db_informat2_biz_prd_0_${DATE}.sql

# MinIO file backup
cp -r /data/minio_home ${BACKUP_DIR}/minio_home_bak_$(date +%F)

# Set permissions
chmod 600 ${BACKUP_DIR}/*.sql

2. Add Scheduled Task (using crontab)

shell
crontab -e

Add the following content (execute backup at 2 AM daily):

0 2 * * * /bin/bash /opt/scripts/backup_zhixin.sh >> /var/log/zhixin_backup.log 2>&1