Open the background of the Z-blog themed experience website. How do I realize automatic data restoration?

Currently, most of Xinglan Studio's works are openExperience the website backgroundIn order to prevent users from confusing the background settings by mistake, I set them on the serverscheduled task, the database in the background of the experience website is reset every day. How is it achieved?

Here is an example of a pagoda:

1. First, back up the specified database;

2. Add scheduled tasks to scheduled tasks;

3. Select the Shell script for the task type. The task name is "Restore a certain database", and I set the execution cycle to 5:30 every day.

4. For script content, you need to fill in shell commands. andrestore the databaseThe backup shell command is:

mysql -u用户名 -p密码 -S /tmp/数据库名 < /home/usrdata/madmin/数据库备份文件名.sql

5. Finally click Add Task.

So, I have many experience website backends. Are they really adding them one task at a time?

In fact, multiple shell commands can be added to the script content, and you just need to wrap the line.

As follows:

mysql -u用户名 -p密码 -S /tmp/数据库名 < /home/usrdata/madmin/数据库备份文件名.sqlmysql -u用户名 -p密码 -S /tmp/数据库名2 < /home/usrdata/madmin/数据库备份文件名2.sql

Of course, if you need to set up different execution cycles, you will need to add new scheduled tasks.

image.png

t like1

Link to this article:https://en.finchui.com/web/100.html

netizens commented

existing1People expressed their opinions
  • 2025-07-31 23:43:46

    The purpose of using this method is to allow users to make arbitrary settings without taking into account when experiencing the background of the website without having to worry about setting the website to be "broken"!

guess you like

hot commodity
popular articles
hot Tags
related tags
FinchUI Store Edition Hong Kong Special Area

share

copy Link

Xinglan Studioadd friends

Working hours: 9:00-22:00
Saturday and Sunday: 14:00-22:00
wechat
Scan the code to add customer service WeChat