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