業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Ubuntu Server26.04 : System Backup and Restore

1. System backup

1.1 Backup under /var/www/html

①Create the backup_all.sh script under /opt/script/

backup_all.sh script contents
10-day data retention

➁Create a directory to store backup files

➂Add a setting to cron to perform regular backups.

1.2 MySQL Database Backup

①Create the db_backup.sh script under /opt/script

db_backup.sh script contents

➁Create a directory to store backup files

③Add a setting to cron to perform regular backups.

2. System Restore

2.1 Restoring Backup Files Under HTML

Store the HTML backup file used for backups in the "/" (root) directory.
Select the backup file with the most recent timestamp.
(Example : www_back_20260424.tar.gz)

2.2 Restore MySQL Database

①Save the DB backup file to any directory and extract the data.

②Restore MySQL

Copied title and URL