Rocky Linux8.6 : System Backup and Restore

1. Backup under /var/www/html

①Creating backup script files

Contents of backup_html.sh

➁authorization

➂Create save directory

④Periodic execution
Add settings to cron for periodic backups

2. MySQL database backup

①Creating backup script files

➁authorization

➂Create save directory

④Periodic execution
Add settings to cron for periodic backups

3. Restore backup files under html

① Store HTML backup files in "/ (root)" directory

➁Expand file

4. Restore Mysql Backup Files

①Save DB backup file to any directory
(In the example, the directory is "/var/www/backup/db_bak") Extract data

➁Restore MySQL