Jump to content
PHP論壇人

13-3.備份資料庫、備份Web目錄的腳本 backup.sh


Recommended Posts

Posted (edited)

-----------------------------------------------------
備份資料庫、備份Web目錄的腳本 backup.sh
-----------------------------------------------------

來源:LNMP一鍵安裝包

 

預設備份檔儲存3天,可以修改backup.sh裡的-3day為你指定的天數

 


我用MariaDB,這裡是改為mariadb

MySQL_Dump="/usr/local/mariadb/bin/mysqldump"


Backup_Dir=("/home/wwwroot/你的域名.com")


Backup_Database=("你的資料庫名稱")

 

MYSQL_PassWord='lnmp.org#隨機密碼'

 

下載後,修改為你的論壇情況,再用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...