Manual:Tools/Fetch: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:
==Properties==
==Properties==


<table class="styled_table">
{{Mr-arg-table-h
<tr>
|prop=Property
  <th width="40%">Property</th>
|desc=Description
  <th >Description</th>
}}
</tr>
 
<tr>
{{Mr-arg-table
    <td><var><b>address</b></var>(<em>string</em>; Default: <b></b>)</td>
|arg=address
    <td>IP address of the device to copy from.</td>
|type=string
</tr>
|default=
<tr>
|desc=IP address of the device to copy file from.
    <td><var><b>ascii</b></var>(<em>yes | no</em>; Default: <b></b>)</td>
}}
    <td></td>
 
</tr>
{{Mr-arg-table
<tr>
|arg=ascii
    <td><var><b>dst-path</b></var>(<em>string</em>; Default: <b></b>)</td>
|type=<nowiki>yes | no</nowiki>
    <td>Title of the input file and file path.</td>
|default=no
</tr>
|desc=
<tr>
}}
    <td><var><b>host</b></var>(<em>string</em>; Default: <b></b>)</td>
 
    <td>Domain name or virtual domain name (if used on web-site, from which you want to copy information). For example,
{{Mr-arg-table
|arg=dst-path
|type=string
|default=
|desc=Destination filename and path
}}
 
{{Mr-arg-table
|arg=host
|type=string
|default=
|desc=Domain name or virtual domain name (if used on web-site, from which you want to copy information). For example,
<pre>address=wiki.mikrotik.com host=forum.mikrotik.com</pre>
<pre>address=wiki.mikrotik.com host=forum.mikrotik.com</pre>
In this example the resolved ip address is the same (66.228.113.27), but hosts are different.</td>
In this example the resolved ip address is the same (66.228.113.27), but hosts are different.
</tr>
}}
<tr>
 
    <td><var><b>keep-result</b></var>(<em>yes|no</em>; Default: <b>yes</b>)</td>
{{Mr-arg-table
    <td>If yes, creates an input file.</td>
|arg=keep-result
</tr>
|type=<nowiki>yes | no</nowiki>
<tr>
|default=yes
    <td><var><b>mode</b></var>(<em>ftp|http|tftp</em>; Default: <b>http</b>)</td>
|desc=If yes, creates an input file.
    <td>Choose the protocol of connection - http, ftp or tftp.</td>
}}
</tr>
 
<tr>
{{Mr-arg-table
    <td><var><b>user</b></var>(<em>string</em>; Default: <b></b>)</td>
|arg=mode
    <td>User name, which is needed to login the remote device.</td>
|type=<nowiki>ftp|http|tftp</nowiki>
</tr>
|default=http
<tr>
|desc=Choose the protocol of connection - http, ftp or tftp.
    <td><var><b>password</b></var>(<em>string</em>; Default: <b></b>)</td>
}}
    <td>Password, which is needed to login the remote device.</td>
 
</tr>
{{Mr-arg-table
<tr>
|arg=password
    <td><var><b>port</b></var>(<em>integer</em>; Default: <b></b>)</td>
|type=string
    <td>Connection port.</td>
|default=anonymous
</tr>
|desc=Password, which is needed for authentication to the remote device.
<tr>
}}
    <td><var><b>src-path</b></var>(<em>string</em>; Default: <b></b>)</td>
 
    <td>Title of the remote file you need to copy.</td>
{{Mr-arg-table
</tr>
|arg=port
<tr>
|type=integer
    <td><var><b>url</b></var>(<em>string</em>; Default: <b></b>)</td>
|default=
    <td>URL pointing to file. Can be used instead of <b>address</b> and <b>src-path</b> parameters</td>
|desc=Connection port.
</tr>
}}
</table>
 
{{Mr-arg-table
|arg=src-path
|type=string
|default=
|desc=Title of the remote file you need to copy.
}}
 
{{Mr-arg-table
|arg=url
|type=string
|default=
|desc=URL pointing to file. Can be used instead of <b>address</b> and <b>src-path</b> parameters.
}}
 
{{Mr-arg-table-end
|arg=user
|type=string
|default=anonymous
|desc=User name, which is needed for authentication to the remote device.
}}





Revision as of 10:07, 1 June 2010

Version.png

Applies to RouterOS: v3, v4 +

Summary

Sub-menu: /tool fetch
Standards:


Fetch is one of the console tools in Mikrotik RouterOS. It is used to copy files from the network device to a Mikrotik.

Properties

Property Description
address (string; Default: ) IP address of the device to copy file from.
ascii (yes | no; Default: no)
dst-path (string; Default: ) Destination filename and path
host (string; Default: ) Domain name or virtual domain name (if used on web-site, from which you want to copy information). For example,
address=wiki.mikrotik.com host=forum.mikrotik.com
In this example the resolved ip address is the same (66.228.113.27), but hosts are different.
keep-result (yes | no; Default: yes) If yes, creates an input file.
mode (ftp|http|tftp; Default: http) Choose the protocol of connection - http, ftp or tftp.
password (string; Default: anonymous) Password, which is needed for authentication to the remote device.
port (integer; Default: ) Connection port.
src-path (string; Default: ) Title of the remote file you need to copy.
url (string; Default: ) URL pointing to file. Can be used instead of address and src-path parameters.
user (string; Default: anonymous) User name, which is needed for authentication to the remote device.


The following example shows how to copy the file with filename "conf.rsc" from device with ip address 192.168.88.2 by FTP protocol and save it as file with filename "123.rsc". User and password are needed to login into the device.

[admin@mt-test] /tool> fetch address=192.168.88.2 src-path=conf.rsc \
user=admin mode=ftp password=123 dst-path=123.rsc port=21 \
host="" keep-result=yes

Another example that demonstrates the usage of url property.

[admin@test_host] /> /tool fetch url="http://www.mikrotik.com/img/netaddresses2.pdf" mode=http 
  status: finished

[admin@test_host] /> /file print 
 # NAME                     TYPE                  SIZE                 CREATION-TIME       
 ...
 5 netaddresses2.pdf        .pdf file             11547                jun/01/2010 11:59:51


[ Top | Back to Content ]