バックアップファイルをMEGAに送信

Nid: 1229
  • Posted on: 11 March 2020
  • By: admin

送信するDrupal バックアップファイルのサイズを確認

$ du -chs /var/www/html/db_*.gz | sort -h
...
73M     /var/www/html/db_tech.octaviadata.com.20200210_212130.tar.gz
3.9G    /var/www/html/db_octaviadata.com.20200210_172948.tar.gz
40G     total

MEGAインストール

$ wget -cP /tmp https://mega.nz/linux/MEGAsync/xUbuntu_19.10/amd64/megacmd_1.1.0_amd64.deb
$ sudo apt install /tmp/megacmd_1.1.0_amd64.deb

MEGAアカウント作成

$ mega-cmd
MEGA CMD> signup eg.email_1@example.co.nz --name="test1"
New Password:
Retype New Password:
Account  created succesfully. You will receive a confirmation link. Use "confirm" with the provided link to confirm that account
MEGA CMD> confirm https://mega.nz/#confirmQFSfjtUkExc5M2Us6q5d-klx60RfxVbxjhk eg.email_1@example.co.nz
Password:
Account eg.email_1@example.co.nz confirmed succesfully. You can login with it now
MEGA CMD> signup eg.email_2@example.co.nz --name="test2"
New Password:
Retype New Password:
Account  created succesfully. You will receive a confirmation link. Use "confirm" with the provided link to confirm that account
MEGA CMD> confirm https://mega.nz/#confirmcz7Ss68ChhMKk8WEFTQCqLMHJg8esAEEpQE eg.email_2@example.co.nz
Password:
Account eg.email_2@example.co.nz confirmed succesfully. You can login with it now

ログイン

MEGA CMD> login eg.email_1@example.co.nz
Password:
[API:info: 23:19:14] Fetching nodes ...
[API:info: 23:19:17] Loading transfers from local cache
[API:info: 23:19:17] Login complete as eg.email_1@example.co.nz
eg.email_1@example.co.nz:/$ logout
Logging out...
MEGA CMD> login octaviadata@outlook.com
Password:
octaviadata@outlook.com:/$ [info: 00:23:08] Login complete as octaviadata@outlook.com
octaviadata@outlook.com:/$ help
Here is the list of available commands and their usage
Use "help -f" to get a brief description of the commands
You can get further help on a specific command with "command" --help
Alternatively, you can use "help" -ff to get a complete description of all commands
Use "help --non-interactive" to learn how to use MEGAcmd with scripts
Use "help --upgrade" to learn about the limitations and obtaining PRO accounts

Commands:
      attr                graphics                  psa
      backup              help                      put
      cancel              https                     pwd
      cat                 import                    quit
      cd                  invite                    reload
      clear               ipc                       rm
      completion          killsession               session
      confirm             lcd                       share
      confirmcancel       log                       showpcr
      cp                  login                     signup
      debug               logout                    speedlimit
      deleteversions      lpwd                      sync
      df                  ls                        thumbnail
      du                  masterkey                 transfers
      errorcode           mediainfo                 tree
      exclude             mkdir                     userattr
      exit                mount                     users
      export              mv                        version
      find                passwd                    webdav
      ftp                 permissions               whoami
      get                 preview
octaviadata@outlook.com:/$ ls
Welcome to MEGA.pdf
octaviadata@outlook.com:/$ df
Cloud drive:               1496628 in       1 file(s) and       0 folder(s)
Inbox:                           0 in       0 file(s) and       0 folder(s)
Rubbish bin:                     0 in       0 file(s) and       0 folder(s)
---------------------------------------------------------------------------
USED STORAGE:              1496628                     0.00% of 53687091200
---------------------------------------------------------------------------
Total size taken up by file versions:            0

ファイル送信

octaviadata@outlook.com:/$ put /var/www/html/db_*.gz
[err: 10:46:16] Unable to open local path: /var/www/html/db_*.tar.gz
octaviadata@outlook.com:/$ quit

ワイルドカード * が使用できないようなので、quitしてから mege-putで送信。

$ mega-put /var/www/html/db_*.tar.gz /

使用状況

$ mega-df -h
Cloud drive:              40.40 GB in      93 file(s) and       0 folder(s)
Inbox:                     0.00  B in       0 file(s) and       0 folder(s)
Rubbish bin:               0.00  B in       0 file(s) and       0 folder(s)
---------------------------------------------------------------------------
USED STORAGE:             40.40 GB                       80.80% of 50.00 GB
---------------------------------------------------------------------------
Total size taken up by file versions:      0.00  B