Debian12.8 ; System Backup & Restore

1. System Backup

1.1 Backup under /var/www/html

① Create backup_all.sh script under /opt/script

backup_all.sh script contents
10-day data storage

Grant execute permissions to scripts

Create a directory to store backup files

Add settings to cron for periodic backups

1.2  MariaDB database backup

Create db_backup.sh script under /opt/script

db_backup.sh script contents
Data storage for 10 days

Grant execute permissions to scripts

Create a directory to store backup files

Add settings to cron for periodic backups

2. System Restore

2.1 Restore backup files under HTML

Store HTML backup files used for backup in the "/ (root)" directory
Select the backup file with the latest timestamp (e.g. www_back_20241124.tar.gz)

2.2 Restore MariaDB database

Save DB backup file to any directory and extract data

Restore MariaDB

Copied title and URL