github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/docs/content/mega.md (about)

     1  ---
     2  title: "Mega"
     3  description: "Rclone docs for Mega"
     4  date: "2018-04-09"
     5  ---
     6  
     7  <i class="fa fa-archive"></i> Mega
     8  -----------------------------------------
     9  
    10  [Mega](https://mega.nz/) is a cloud storage and file hosting service
    11  known for its security feature where all files are encrypted locally
    12  before they are uploaded. This prevents anyone (including employees of
    13  Mega) from accessing the files without knowledge of the key used for
    14  encryption.
    15  
    16  This is an rclone backend for Mega which supports the file transfer
    17  features of Mega using the same client side encryption.
    18  
    19  Paths are specified as `remote:path`
    20  
    21  Paths may be as deep as required, eg `remote:directory/subdirectory`.
    22  
    23  Here is an example of how to make a remote called `remote`.  First run:
    24  
    25       rclone config
    26  
    27  This will guide you through an interactive setup process:
    28  
    29  ```
    30  No remotes found - make a new one
    31  n) New remote
    32  s) Set configuration password
    33  q) Quit config
    34  n/s/q> n
    35  name> remote
    36  Type of storage to configure.
    37  Choose a number from below, or type in your own value
    38   1 / Alias for an existing remote
    39     \ "alias"
    40  [snip]
    41  14 / Mega
    42     \ "mega"
    43  [snip]
    44  23 / http Connection
    45     \ "http"
    46  Storage> mega
    47  User name
    48  user> you@example.com
    49  Password.
    50  y) Yes type in my own password
    51  g) Generate random password
    52  n) No leave this optional password blank
    53  y/g/n> y
    54  Enter the password:
    55  password:
    56  Confirm the password:
    57  password:
    58  Remote config
    59  --------------------
    60  [remote]
    61  type = mega
    62  user = you@example.com
    63  pass = *** ENCRYPTED ***
    64  --------------------
    65  y) Yes this is OK
    66  e) Edit this remote
    67  d) Delete this remote
    68  y/e/d> y
    69  ```
    70  
    71  **NOTE:** The encryption keys need to have been already generated after a regular login
    72  via the browser, otherwise attempting to use the credentials in `rclone` will fail.
    73  
    74  Once configured you can then use `rclone` like this,
    75  
    76  List directories in top level of your Mega
    77  
    78      rclone lsd remote:
    79  
    80  List all the files in your Mega
    81  
    82      rclone ls remote:
    83  
    84  To copy a local directory to an Mega directory called backup
    85  
    86      rclone copy /home/source remote:backup
    87  
    88  ### Modified time and hashes ###
    89  
    90  Mega does not support modification times or hashes yet.
    91  
    92  ### Duplicated files ###
    93  
    94  Mega can have two files with exactly the same name and path (unlike a
    95  normal file system).
    96  
    97  Duplicated files cause problems with the syncing and you will see
    98  messages in the log about duplicates.
    99  
   100  Use `rclone dedupe` to fix duplicated files.
   101  
   102  ### Failure to log-in ###
   103  
   104  Mega remotes seem to get blocked (reject logins) under "heavy use".
   105  We haven't worked out the exact blocking rules but it seems to be
   106  related to fast paced, sucessive rclone commands.
   107  
   108  For example, executing this command 90 times in a row `rclone link
   109  remote:file` will cause the remote to become "blocked". This is not an
   110  abnormal situation, for example if you wish to get the public links of
   111  a directory with hundred of files...  After more or less a week, the
   112  remote will remote accept rclone logins normally again.
   113  
   114  You can mitigate this issue by mounting the remote it with `rclone
   115  mount`. This will log-in when mounting and a log-out when unmounting
   116  only. You can also run `rclone rcd` and then use `rclone rc` to run
   117  the commands over the API to avoid logging in each time.
   118  
   119  Rclone does not currently close mega sessions (you can see them in the
   120  web interface), however closing the sessions does not solve the issue.
   121  
   122  If you space rclone commands by 3 seconds it will avoid blocking the
   123  remote. We haven't identified the exact blocking rules, so perhaps one
   124  could execute the command 80 times without waiting and avoid blocking
   125  by waiting 3 seconds, then continuing...
   126  
   127  Note that this has been observed by trial and error and might not be
   128  set in stone.
   129  
   130  Other tools seem not to produce this blocking effect, as they use a
   131  different working approach (state-based, using sessionIDs instead of
   132  log-in) which isn't compatible with the current stateless rclone
   133  approach.
   134  
   135  Note that once blocked, the use of other tools (such as megacmd) is
   136  not a sure workaround: following megacmd login times have been
   137  observed in sucession for blocked remote: 7 minutes, 20 min, 30min, 30
   138  min, 30min. Web access looks unaffected though.
   139  
   140  Investigation is continuing in relation to workarounds based on
   141  timeouts, pacers, retrials and tpslimits - if you discover something
   142  relevant, please post on the forum.
   143  
   144  So, if rclone was working nicely and suddenly you are unable to log-in
   145  and you are sure the user and the password are correct, likely you
   146  have got the remote blocked for a while.
   147  
   148  <!--- autogenerated options start - DO NOT EDIT, instead edit fs.RegInfo in backend/mega/mega.go then run make backenddocs -->
   149  ### Standard Options
   150  
   151  Here are the standard options specific to mega (Mega).
   152  
   153  #### --mega-user
   154  
   155  User name
   156  
   157  - Config:      user
   158  - Env Var:     RCLONE_MEGA_USER
   159  - Type:        string
   160  - Default:     ""
   161  
   162  #### --mega-pass
   163  
   164  Password.
   165  
   166  - Config:      pass
   167  - Env Var:     RCLONE_MEGA_PASS
   168  - Type:        string
   169  - Default:     ""
   170  
   171  ### Advanced Options
   172  
   173  Here are the advanced options specific to mega (Mega).
   174  
   175  #### --mega-debug
   176  
   177  Output more debug from Mega.
   178  
   179  If this flag is set (along with -vv) it will print further debugging
   180  information from the mega backend.
   181  
   182  - Config:      debug
   183  - Env Var:     RCLONE_MEGA_DEBUG
   184  - Type:        bool
   185  - Default:     false
   186  
   187  #### --mega-hard-delete
   188  
   189  Delete files permanently rather than putting them into the trash.
   190  
   191  Normally the mega backend will put all deletions into the trash rather
   192  than permanently deleting them.  If you specify this then rclone will
   193  permanently delete objects instead.
   194  
   195  - Config:      hard_delete
   196  - Env Var:     RCLONE_MEGA_HARD_DELETE
   197  - Type:        bool
   198  - Default:     false
   199  
   200  <!--- autogenerated options stop -->
   201  
   202  ### Limitations ###
   203  
   204  This backend uses the [go-mega go library](https://github.com/t3rm1n4l/go-mega) which is an opensource
   205  go library implementing the Mega API. There doesn't appear to be any
   206  documentation for the mega protocol beyond the [mega C++ SDK](https://github.com/meganz/sdk) source code
   207  so there are likely quite a few errors still remaining in this library.
   208  
   209  Mega allows duplicate files which may confuse rclone.