[inlosc_lg_title]1、备份[/inlosc_lg_title]
使用XAMPP的PHP网站集成环境,不仅轻松的解决网站所需环境,他的备份功能也非常强大。下面让我们输入几句命令来完成数据库和网站的自动备份:
/opt/lampp/lampp backup **** #命令后面跟着的是MySQL 的 root 用户的密码。命令执行后会看到下面的内容:
Backing up databases...
Backing up configuration, log and htdocs files...
Calculating checksums...
Building final backup file...
Backup finished.
Take care of /opt/lampp/backup/xampp-backup-19-02-06.sh
[inlosc_lg_title]2、恢复[/inlosc_lg_title]
恢复以前的备份,只需以 root 用户身份运行下面的命令:
sh /opt/lampp/backup/xampp-backup-19-02-06.sh **** #命令后面跟着的是MySQL 的 root 用户的密码,这时用户将看到如下信息:
Checking integrity of files...
Restoring configuration, log and htdocs files...
Checking versions...
Installed: XAMPP 1.5.1
Backup from: XAMPP 1.5.1
Restoring MySQL databases...
Restoring MySQL user databases...
Backup complete. Have fun!
You may need to restart XAMPP to complete the restore.
恢复完后,需要重新启动XAMPP,才能使恢复的数据可用。
[inlosc_lg_title]3、创建计划任务[/inlosc_lg_title]
xampp平台在linux系统中mysql数据库的数据文件目录 /opt/lampp/var/mysql
备份可以直接添加到crontab上。
crontab -e 0 0 1 * * /opt/lampp/lampp backup ****(数据库密码)