Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to easily back up server files to OSS

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about how to easily back up server files to OSS. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

Introduction

The protagonist of the tutorial is alicloud-duplicity, which is an open source backup tool that supports OSS storage on the basis of duplicity, and alicloud-duplicity supports all commands and parameters of duplicity. Duplicity is an open source backup tool that uses librsync to support incremental backups, saves local storage space, and uses GnuPG to encrypt data. Duplicity can easily back up data to local, shared storage and cloud storage.

Full and incremental backups can be implemented, encrypted and uploaded to OSS using alicloud-duplicity.

Demand & harvest

Products that need to be used:

Any (server / ECS/ lightweight application server (install any Linux distribution image)

two。 Aliyun OSS products

Installation

Recommended operating systems: Ubuntu, Debian

I. the installation system depends on

Apt update & & apt install librsync-dev python-pip python-dev git-y

Second, install py dependencies

Pip install oss2 fasteners configparser setuptools

III. Installation program

Mkdir-p / root/src/cd / root/src/git clone https://github.com/aliyun/alicloud-duplicity.gitcd alicloud-duplicitypython setup.py install

IV. Verification

That is, check to see if the version number appears when you run the relevant command:

Alicloud-duplicity-V Settings OSS Settin

First of all, we need to open OSS

2. Then create an OSS Bucket in the same region as Aliyun ECS

Cdn.com/00d54734a365b3dca3681e0c013d28b68ecd483d.png ">

Third, low-frequency access is selected for storage type, and read and write permissions are private. Because backups are not accessed frequently, we can choose lower-cost low-frequency access, and we certainly don't want others to visit, which is naturally private.

4. Then go to access Control (RAM) to create a user specially prepared for OSS. Be sure to record AccessKeyID and AccessKeySecret

Click Policy Management, and then click New Authorization Policy

6. Click the blank template directly, and then enter the authorization policy name, and enter the policy content as follows:

{"Statement": [{"Action": "oss:*", "Effect": "Allow", "Resource": ["acs:oss:*:*:mf8-oss-back", "acs:oss:*:*:mf8-oss-back/*"]}], "Version": "1"}

Since my OSS Bucket is mf8-oss-back, "acs:oss:*:*:mf8-oss-back" and "acs:oss:*:*:mf8-oss-back/*" are followed by mf8-oss-back. You can change it to your own OSS Bucket name.

Then click New Authorization Policy Save

7. Authorize the user

Just choose the authorization policy we just created

Server Settin

Create a profile

Run:

Cat > > ~ / .alicloud.cfg > ~ / .alicloud.cfg

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report