Jump to content
PHP論壇人

17.备份脚本 backup.sh


Jack

Recommended Posts

-----------------------------------------------------
备份数据库、备份Web目录的脚本 backup.sh
-----------------------------------------------------

来源:军哥LNMP一键安装包

https://lnmp.org/faq/lnmp-1-2-tools.html

默认备份文件保存3天,可以修改backup.sh里的-3day为你指定的天数

我用MariaDB
MySQL_Dump="/usr/local/mariadb/bin/mysqldump"

Backup_Dir=("/home/wwwroot/修改为你的论坛.com")

Backup_Database=("修改为你的论坛数据库名")

MYSQL_UserName='你的数据库root帐户'

MYSQL_PassWord='你的数据库root帐户密码'

 

 

下载后,修改为你的论坛情况,再用SFTP将backup.sh上传到 /root/ 目录

backup.sh

 

Edited by Jack
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...