1megatools-test(1) megatools-test(1)
2
3
4
6 megatools test - Test for existence of files or folders
7
9 megatools test [-f|-d] <remotepaths>...
10
12 Tests for existence of files or paths of files stored on Mega.nz.
13
14 If all <remotepaths> match the condition, the tool returns status code
15 0.
16
17 If one of the <remotepaths> doesn’t exist, the tool returns 1.
18
19 If one of the <remotepaths> doesn’t match the -f or -d filter, the tool
20 returns 2.
21
22 For other errors, the tool returns 3.
23
25 --file , -f
26 Require all <remotepaths> to be files.
27
28 --folder , -d
29 Require all <remotepaths> to be folders.
30
31 -u <email> , --username <email>
32 Account username (email)
33
34 -p <password> , --password <password>
35 Account password
36
37 --no-ask-password
38 Never ask interactively for a password
39
40 --reload
41 Reload filesystem cache
42
43 --limit-speed <speed>
44 Set maximum allowed upload and download speed in KiB/s. This
45 option overrides config file settings. 0 means no limit. When
46 using ParallelTransfers > 1, upload speed limit is applied to
47 each transfer individually.
48
49 --proxy <proxy>
50 Use proxy server to connect to mega.nz. This option overrides
51 config file settings. More information can be found in libcurl
52 documentation at ⟨https://curl.haxx.se/libcurl/c/CUR‐
53 LOPT_PROXY.html⟩. Some acceptable values are:
54
55 • none : Disable proxy if it was enabled in the config file.
56
57 • socks5://localhost:9050 : Local SOCKSv5 proxy server
58
59 • socks5h://localhost:9050 : Local SOCKSv5 proxy server with DNS
60 handled by the proxy
61
62 --netif <ifname|ip>
63 Network interface or local IP address used for outgoing connec‐
64 tions. You have to specify IP address bound to some of your lo‐
65 cal network interfaces, when specifying an IP address.
66
67 --ip-proto <proto>
68 Which IP protocol to prefer when connecting to mega.nz (v4, v6,
69 or any). This is just an advisory option. Megatools will re‐
70 solve mega.nz domain, and then use an A or AAAA record based on
71 the stated preference.
72
73 --config <path>
74 Load configuration from a file
75
76 --ignore-config-file
77 Disable loading .megarc
78
79 --debug [<options>]
80 Enable debugging of various aspects of the megatools operation.
81 You may enable multiple debugging options separated by commas.
82 (eg. --debug api,fs)
83
84 Available options are:
85
86 • http: Dump HTTP request/response details (can be used to debug
87 connection/proxy issues)
88
89 • api: Dump Mega.nz API calls
90
91 • fs: Dump Mega.nz filesystem (may require --reload to actually
92 print something)
93
94 • cache: Dump cache contents
95
96 • tman: Dump transfer manager events
97
98 --version
99 Show version information
100
101 <remotepaths>
102 One or more remote filesystem paths to test.
103
105 • Test for existence of a path:
106
107 $ megatools test /Root/README
108 $ test $? -eq 0 && echo "File or folder exists at /Root/README"
109 File or folder exists at /Root/README
110
111 • Test for existence of multiple files:
112
113 $ megatools test -f /Root/file1 /Root/file2
114 $ test $? -eq 0 && echo "/Root/file1 and /Root/file2 are both files"
115 /Root/file1 and /Root/file2 are both files
116
118 Mega.nz filesystem is represented as a tree of nodes of various types.
119 Nodes are identified by a 8 character node handles (eg. 7Fdi3ZjC).
120 Structure of the filesystem is not encrypted.
121
122 Megatools maps node tree structure to a traditional filesystem paths
123 (eg. /Root/SomeFile.DAT).
124
125 NOTE: By the nature of Mega.nz storage, several files in the directory
126 can have the same name. To allow access to such files, the names of
127 conflicting files are extended by appending dot and their node handle
128 like this:
129
130 /Root/conflictingfile
131 /Root/conflictingfile.7Fdi3ZjC
132 /Root/conflictingfile.mEU23aSD
133
134 You need to be aware of several special folders:
135
136 /Root Writable directory representing the root of the filesystem.
137
138 /Trash Trash directory where Mega.nz web client moves deleted files.
139 This directory is not used by megatools when removing files.
140
141 /Inbox Not sure.
142
143 /Contacts
144 Directory containing subdirectories representing your contacts
145 list. If you want to add contacts to the list, simply create
146 subdirectory named after the contact you want to add.
147
148 /Contacts/<email>
149 Directories representing individual contacts in your contacts
150 list. These directories contain folders that others shared with
151 you. All shared files are read-only, at the moment.
152
154 megatools(1), megarc(5), megatools-df(1), megatools-dl(1), megatools-
155 get(1), megatools-ls(1), megatools-mkdir(1), megatools-put(1), mega‐
156 tools-reg(1), megatools-rm(1), megatools-copy(1).
157
159 Part of the megatools(1) suite of commands.
160
162 Report bugs to megatools@megous.com ⟨mailto:megatools@megous.com⟩ .
163 Your message will end up in a public archive, so be careful what you
164 say or send.
165
167 Megatools was written by Ondrej Jirman < megatools@megous.com
168 ⟨mailto:megatools@megous.com⟩ >, 2013-2019.
169
170 Official website is ⟨http://megatools.megous.com⟩.
171
172
173
174 26 January 2021 megatools-test(1)