���u�n�o�b�N�A�b�v�iRclone�j

�ŏI�X�V���F 2022.12.11

���T�v

�f�B�X�N�̏���Ђɔ����āA�o�b�N�A�b�v�f�[�^�����u�n�փo�b�N�A�b�v����B
�����ł́ARclone�𗘗p���ăo�b�N�A�b�v�f�[�^���N���E�h�X�g���[�WMEGA(������20GB�܂Ŏg����)�Ƀo�b�N�A�b�v����B


��MEGA�o�^

�����A�J�E���g���쐬

��Rclone�C���X�g�[��

[root@centos ~]# yum install -y epel-release�@���@EPEL���|�W�g���C���X�g�[��

[root@centos ~]# yum install -y rclone�@���@Rclone�C���X�g�[��

��Rclone�ݒ�

[root@centos ~]# rclone config�@���@Rclone�ݒ�J�n
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n�@���@n(�V�K�쐬)����
name> Mega�@���@�C�ӂ̃����[�g�o�b�N�A�b�v�於(��:Mega)����
Option Storage.
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value.
 1 / 1Fichier
   \ "fichier"
 2 / Alias for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, and Tencent COS
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Citrix Sharefile
   \ "sharefile"
 9 / Compress a remote
   \ "compress"
10 / Dropbox
   \ "dropbox"
11 / Encrypt/Decrypt a remote
   \ "crypt"
12 / Enterprise File Fabric
   \ "filefabric"
13 / FTP Connection
   \ "ftp"
14 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
15 / Google Drive
   \ "drive"
16 / Google Photos
   \ "google photos"
17 / Hadoop distributed file system
   \ "hdfs"
18 / Hubic
   \ "hubic"
19 / In memory object storage system.
   \ "memory"
20 / Jottacloud
   \ "jottacloud"
21 / Koofr
   \ "koofr"
22 / Local Disk
   \ "local"
23 / Mail.ru Cloud
   \ "mailru"
24 / Mega
   \ "mega"
25 / Microsoft Azure Blob Storage
   \ "azureblob"
26 / Microsoft OneDrive
   \ "onedrive"
27 / OpenDrive
   \ "opendrive"
28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
29 / Pcloud
   \ "pcloud"
30 / Put.io
   \ "putio"
31 / QingCloud Object Storage
   \ "qingstor"
32 / SSH/SFTP Connection
   \ "sftp"
33 / Sugarsync
   \ "sugarsync"
34 / Tardigrade Decentralized Cloud Storage
   \ "tardigrade"
35 / Transparently chunk/split large files
   \ "chunker"
36 / Union merges the contents of several upstream fs
   \ "union"
37 / Webdav
   \ "webdav"
38 / Yandex Disk
   \ "yandex"
39 / Zoho
   \ "zoho"
40 / http Connection
   \ "http"
41 / premiumize.me
   \ "premiumizeme"
42 / seafile
   \ "seafile"
Storage> 24�@���@24(Mega)����
Option user.
User name.
Enter a string value. Press Enter for the default ("").
user> xxxxxxxx@example.com�@���@���[�U�[������
Option pass.
Password.
Choose an alternative below.
y) Yes type in my own password
g) Generate random password
y/g> y�@���@y����
Enter the password:
password:�@���@�p�X���[�h����
Confirm the password:
password:�@���@�p�X���[�h����(�m�F)
Edit advanced config?
y) Yes
n) No (default)
y/n>�@���@��ENTER
--------------------
[Mega]
type = mega
user = xxxxxxxx@example.com
pass = *** ENCRYPTED ***
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>�@���@��ENTER
Current remotes:

Name                 Type
====                 ====
Mega                 mega

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q�@���@q(�I��)����

��Rclone�m�F

[root@centos ~]# rclone copy /backup/backup.tar.bz2 Mega:�@���@�o�b�N�A�b�v�t�@�C����Mega�փA�b�v���[�h

[root@centos ~]# rclone ls Mega:�@���@�A�b�v���[�h�m�F
943038443 backup.tar.bz2

[root@centos ~]# rclone copy Mega:backup.tar.bz2 .�@���@�o�b�N�A�b�v�t�@�C����Mega����_�E�����[�h

[root@centos ~]# ll backup.tar.bz2�@���@�_�E�����[�h�m�F
-rw-r--r-- 1 root root 943038443 12�� 10 04:21 backup.tar.bz2

[root@centos ~]# rclone delete Mega:backup.tar.bz2�@���@�o�b�N�A�b�v�t�@�C����Mega����폜

[root@centos ~]# rclone ls Mega:�@���@�폜�m�F

���o�b�N�A�b�v�f�[�^��Mega�֕ۑ�

�����o�b�N�A�b�v�^�p�ŃT�[�o�[���̃f�B�X�N�ɕۑ������o�b�N�A�b�v�f�[�^��Mega�֕ۑ�����B

[root@centos ~]# vi backup_to_rclone.sh�@���@Rclone�o�b�N�A�b�v�X�N���v�g�쐬
#!/bin/bash

# �o�b�N�A�b�v�t�@�C������`
BACKUPFILE=/backup/backup.tar.bz2

# �o�b�N�A�b�v
rclone copyto ${BACKUPFILE} Mega:`hostname`_`basename ${BACKUPFILE}`

# ���ݔ��N���A
rclone cleanup Mega:

exit 0

[root@centos ~]# chmod +x backup_to_rclone.sh�@���@Rclone�o�b�N�A�b�v�X�N���v�g�֎��s�����t��

[root@centos ~]# bash backup_to_rclone.sh�@���@Rclone�o�b�N�A�b�v�X�N���v�g���s

[root@centos ~]# rclone ls Mega:�@���@�o�b�N�A�b�v�m�F
943038443 centos.centossrv.com_backup.tar.bz2

Mega�ł��o�b�N�A�b�v���m�F

[root@centos ~]# vi /etc/cron.d/backup�@���@�����o�b�N�A�b�v�^�p�Ƃ̘A�g
0 5 * * * root /root/backup.sh && /root/backup_to_rclone.sh�@���@���[�J���o�b�N�A�b�v������Ƀo�b�N�A�b�v��MEGA�փo�b�N�A�b�v����


���֘A�R���e���c




�����̃y�[�W�̃g�b�v�֖߂�

�v���C�o�V�[�|���V�[
centossrv.com