×
Community Blog Back up from Alibaba Cloud OSS to Your Synology NAS Internally

Back up from Alibaba Cloud OSS to Your Synology NAS Internally

This article explains how to back up OSS to Synology NAS step-by-step.

By Vincent Siu, Alibaba Cloud Certified Expert - Cloud Computing

Hey guys, this is all about OSS backups! This tutorial is based on Alibaba Cloud, but the concept works the same on any cloud. Before we start, I recommend reading this article, which is written by Wojciech Marusiak. Also, I got inspiration from Anto Online.

First of all, if you have files on OSS and want to back them up to your local drive, there are two options, public endpoint and internal endpoint. Since going through a public endpoint is too easy, I won't discuss it here. As long as you have a private connection between your data center and your virtual private cloud (VPC), such as Alibaba Express Connect, this article is for you.

Prerequisites

  • You need Alibaba Express Connect.
  • You need a Synology NAS (IP is 10.20.30.40) and administrative privileges.
  • You need permission for the OSS Bucket.
  • You have already configured access_key_id and secret_access_key on Alibaba Cloud for this task.
  • You have a fair understanding of using terminal and shell commands.

Procedure

1. Configuring the Routing Table

1.1) Log in to the account on Alibaba Cloud

1.2) Navigate to Express Connect > Virtual Border Routers (VBRs)

1.3) Click the Instance ID you ordered from ISP

1.4) Click the Advertised BGP Subnets tab

1.5) Click Advertise BGP Subnet to add the VIP for your region (I am in Hong Kong, so I picked the VIP according to this table.)

1

2. Connecting Synology NAS and Getting Root Permission

# ssh 10.20.30.40
# sudo -i

3. Download the Rclone Install Script

# wget https://rclone.org/install.sh | chmod +x install.sh

4. Install Rclone

# ./install.sh

5. Create the Rclone Config File

Please refer to this document for details

# rclone config

6. Follow the On-Screen Instructions

The summary after configuring [rclone config] is listed below:

[AliOSS]
type = s3
provider = Alibaba
access_key_id = Your-key-id-put-here
secret_access_key = Your-access-key-put-here
endpoint = oss-cn-hongkong-internal.aliyuncs.com
acl = private

Note: This is the gem in this tutorial. I made sure to select an internal endpoint. The backup path must go through Express Connect.

7. Run Rclone Manually

# ssh 10.20.30.40
# rclone lsf AliOSS:your-bucket
# rclone sync AliOSS:your-bucket /volume1/Folder-on-NAS -v

Note: This graph shows there is only intranet traffic after using rclone, and I saved traffic costs!

2

8. Run Rclone by a Cron Job (Optional)

Credit to Anto's editorial team

8.1) Log in to the Synology NAS (I suggest creating a user for this task, such as BAKoperator.)

8.2) Navigate to Control Panel > Task Scheduler

8.3) Click the create button and then click scheduled task > user-defined script

8.4) On the create task window, enter your task name in the general settings tab

8.5) Choose the schedule on the schedule tab

8.6) On the task setting tab, enter your user-defined script

3

Credits and References

1) How to Use Alibaba Cloud Object Storage Service with QNAP - Alibaba Cloud Community

2) Backup with Rclone and Cron from your Synology NAS - Anto ./ Online

3) How can I sign in to DSM/SRM with root privilege via SSH? - Synology Knowledge Center

4) OSS internal endpoints and VIP ranges

0 0 0
Share on

vincentsiu

3 posts | 0 followers

You may also like

Comments

vincentsiu

3 posts | 0 followers

Related Products