OneinStack comes with local/remote backup website files and database usage methods

888u

Last update at :2024-06-14,Edit by888u

In the past, we used more Linux VPS one-click packages, maybe Junge LNMP. Of course, there are currently a lot of users of this one-click package. Seeing that Junge LNMP1.4 version has been in public beta and has not been officially launched, Snail will go and experience the differences between the actual functions of the new version 1.4 and the current version 1.3 in a few days. And in recent times, the OneinStack one-click script released by LinuxEye bloggers has attracted a lot of users in a short period of time.

OneinStack's one-click script is characterized by a large number of combination packages. You can choose to install automatically from LAMP, LNMP, lnmpa, lnmt, lnmh, etc., and the software package version is updated quickly. Judging from the discussions among netizens, some have always insisted on and like Junge LNMP, while others have switched to OneinStack from WEB panels or other scripts. Each has its own advantages. (There are also experts who like to compile and install by themselves)

It is true that the one-click package makes it much more convenient for us to deploy the Web environment on Linux systems, and there are some automated tools, such as quick installation of SSL, adding sites, databases, etc., which can be created and set up with script tools. During the operation and maintenance process, data Backup is also crucial. OneinStack comes with its own backup tool. We can set up local and remote server backups, and of course can also schedule backups. Let’s take a look here.

First, preparation for using OneinStack backup function/tool

1. We need the current server to use the OneinStack one-click package (oneinstack.com). If we do not install this environment, we will definitely not be able to use the backup script.

2. Should we consider local backup or remote backup? If it is the latter, we also need to prepare a remote VPS or server to receive the backed up files and databases.

3. If we are using it for the first time, it is recommended to play it on the test machine first and then use it in the production environment to avoid any accidents.

Second, OneinStack backup configuration file

Before we back up, we need to configure the file, such as local backup or remote backup, or both, and also include backup database or backup file, all of which need to be set in advance.

1. Backup script execution

./backup_setup.sh

Here we need to go to the root directory (see where our own installation package is) and execute the command.

2. Backup parameter setting steps

A – Set up remote or local backup

Here we can choose local, remote, or both to back up together. Here I will demonstrate that we will back up together, select 3, and press Enter.

B – Backup database, website options

Based on our actual needs, whether to back up only the database, website files, or both.

C – Back up local website settings

Local website settings, this includes which directory we back up to the current server (the default is also acceptable), the default backup days are 5 days, and those before 5 days will be automatically deleted to save server storage. If our server hard disk is large enough, it can be set For a longer period of time, backup databases (if multiple databases are separated by commas), and backup website files, you can select one or more separated by commas.

D – Remote Server Settings

Here we can set the information of the remote server, which will detect whether it can be connected. We can also add multiple servers, so that the backup can be pushed to multiple servers. If necessary, the backup can be backed up to multiple servers.

Third, OneinStack performs backup and scheduled backup settings

We have set up the configuration file in the second step. We can back up to multiple servers according to actual needs, or we can just back up to local and download it manually. After the configuration is complete, we can start testing backup and set up scheduled backup.

1. Perform backup

./backup.sh

After throwing the above backup script into the current server, the backup we set above will be automatically executed.

We can see that everything is executed automatically. After the execution is completed, we will have two compressed packages in the /data/backup directory of the local server and the corresponding directory of the remote server, one is the database and the other is the website file. (It would be fine if you can customize the remote directory file when configuring the file in the future, so that you can directly connect to the backup website directory)

2. Set up scheduled backup

We can set up scheduled backups so that we don’t have to execute commands every time we back up. Of course, if your data updates less, it doesn't matter if you simply execute it every time. In this way, you can see whether it is complete during execution. We can't rely too much on automation. If the backup is not successful, we will still consider it successful.

crontab -e

Execute the scheduled file and then add the script.

0 2 * * * cd ~/oneinstack;./backup.sh > /dev/null 2>&1 &

After saving and exiting, it can be executed automatically. For example, the backup was executed at 2 o'clock every day. If we don't need it so frequently, we can set a backup once a week or a specific time. You can refer to the crontab timestamp writing method.

Fourth, summary of OneinStack backup website and database tools

1. The OneinStack backup tool is relatively convenient to use. You only need to configure the file first and execute and set up scheduled backup.

2. We can set up scheduled backups, or we can back up when we think of it. I personally recommend downloading and saving it locally regularly.

Recommended site search: free foreign space, website registration, free cn domain name registration, Alibaba Cloud domain name registration, registration-free jsp space, check IP, free domain name registration, independent IP, rent server, cc domain name,

OneinStack comes with local/remote backup website files and database usage methods

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码