RouterOS question
I am trying to achieve something using RouterOS scripting, and I'm hoping that here I might find the appropriate expertise.
From a script running in a Mikrotik router I wish to pull in a copy of a file from an attached Windows computer. The computer is on the same subnet as the router.
By way of illustration: A file called test.xxx exists on a Windows computer in the folder c:\aaa\ I want a copy of this file to appear in the attached router /file list. This copy "event" could be either a push from the computer, or a pull from the router. When using Winbox, this function is achieved easily using "drag and drop", but I need to automate the function. Thanks. RobK7QJ
Sounds like you just need /tool fetch. https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch The blacklist script is a thorough example: https://github.com/kd7lxl/blacklist-service/blob/master/block-address.rsc On Tue, Nov 22, 2022, 19:00 Rob Martin via PSDR <psdr@hamwan.org> wrote:
I am trying to achieve something using RouterOS scripting, and I'm hoping that here I might find the appropriate expertise.
From a script running in a Mikrotik router I wish to pull in a copy of a file from an attached Windows computer. The computer is on the same subnet as the router.
By way of illustration:
A file called test.xxx exists on a Windows computer in the folder c:\aaa\
I want a copy of this file to appear in the attached router /file list. This copy "event" could be either a push from the computer, or a pull from the router.
When using Winbox, this function is achieved easily using "drag and drop", but I need to automate the function.
Thanks.
Rob K7QJ
_______________________________________________ PSDR mailing list PSDR@hamwan.org http://mail.hamwan.net/mailman/listinfo/psdr
Yep just use fetch with mpde=ftp and setup ftp server on windows box, problem solved On Wed, Nov 23, 2022 at 12:57 AM Tom Hayward <tom@tomh.us> wrote:
Sounds like you just need /tool fetch. https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch
The blacklist script is a thorough example: https://github.com/kd7lxl/blacklist-service/blob/master/block-address.rsc
On Tue, Nov 22, 2022, 19:00 Rob Martin via PSDR <psdr@hamwan.org> wrote:
I am trying to achieve something using RouterOS scripting, and I'm hoping that here I might find the appropriate expertise.
From a script running in a Mikrotik router I wish to pull in a copy of a file from an attached Windows computer. The computer is on the same subnet as the router.
By way of illustration:
A file called test.xxx exists on a Windows computer in the folder c:\aaa\
I want a copy of this file to appear in the attached router /file list. This copy "event" could be either a push from the computer, or a pull from the router.
When using Winbox, this function is achieved easily using "drag and drop", but I need to automate the function.
Thanks.
Rob K7QJ
_______________________________________________ PSDR mailing list PSDR@hamwan.org http://mail.hamwan.net/mailman/listinfo/psdr
_______________________________________________ PSDR mailing list PSDR@hamwan.org http://mail.hamwan.net/mailman/listinfo/psdr
-- Thanks, Jamie Owens
Alternatively, you can push from Windows, by having an SSH key installed and using SCP: https://stackoverflow.com/questions/35292681/pscp-file-from-windows-to-linux... --Bart On 11/23/2022 12:59 AM, Jamie Owens wrote:
Yep just use fetch with mpde=ftp and setup ftp server on windows box, problem solved
On Wed, Nov 23, 2022 at 12:57 AM Tom Hayward <tom@tomh.us> wrote:
Sounds like you just need /tool fetch. https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch
The blacklist script is a thorough example: https://github.com/kd7lxl/blacklist-service/blob/master/block-address.rsc
On Tue, Nov 22, 2022, 19:00 Rob Martin via PSDR <psdr@hamwan.org> wrote:
I am trying to achieve something using RouterOS scripting, and I'm hoping that here I might find the appropriate expertise.
From a script running in a Mikrotik router I wish to pull in a copy of a file from an attached Windows computer. The computer is on the same subnet as the router.
By way of illustration:
A file called test.xxx exists on a Windows computer in the folder c:\aaa\
I want a copy of this file to appear in the attached router /file list. This copy "event" could be either a push from the computer, or a pull from the router.
When using Winbox, this function is achieved easily using "drag and drop", but I need to automate the function.
Thanks.
Rob K7QJ
_______________________________________________ PSDR mailing list PSDR@hamwan.org http://mail.hamwan.net/mailman/listinfo/psdr
_______________________________________________ PSDR mailing list PSDR@hamwan.org http://mail.hamwan.net/mailman/listinfo/psdr
-- Thanks, Jamie Owens
_______________________________________________ PSDR mailing list PSDR@hamwan.org http://mail.hamwan.net/mailman/listinfo/psdr
Bart’s suggestion is a better way as it is much more secure. Allowing FTP to be run at any time in RouterOS is asking for trouble, as it can be potentially be used for a bad actor to infect your device. SCP (Secure Copy Protocol) is not only encrypted but using Secure Shell (SSH) to access it helps prevent problems. Stephen W9SK From: PSDR <psdr-bounces@hamwan.org> On Behalf Of Bart Kus Sent: Wednesday, November 23, 2022 10:53 AM To: Puget Sound Data Ring <psdr@hamwan.org>; Jamie Owens <jlowens76@gmail.com> Cc: Rob Martin <rgmrob@yahoo.com> Subject: Re: [HamWAN PSDR] RouterOS question Alternatively, you can push from Windows, by having an SSH key installed and using SCP: https://stackoverflow.com/questions/35292681/pscp-file-from-windows-to-linux... --Bart On 11/23/2022 12:59 AM, Jamie Owens wrote: Yep just use fetch with mpde=ftp and setup ftp server on windows box, problem solved On Wed, Nov 23, 2022 at 12:57 AM Tom Hayward <tom@tomh.us <mailto:tom@tomh.us> > wrote: Sounds like you just need /tool fetch. https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch The blacklist script is a thorough example: https://github.com/kd7lxl/blacklist-service/blob/master/block-address.rsc On Tue, Nov 22, 2022, 19:00 Rob Martin via PSDR <psdr@hamwan.org <mailto:psdr@hamwan.org> > wrote: I am trying to achieve something using RouterOS scripting, and I'm hoping that here I might find the appropriate expertise.
From a script running in a Mikrotik router I wish to pull in a copy of a file from an attached Windows computer. The computer is on the same subnet as the router.
By way of illustration: A file called test.xxx exists on a Windows computer in the folder c:\aaa\ I want a copy of this file to appear in the attached router /file list. This copy "event" could be either a push from the computer, or a pull from the router. When using Winbox, this function is achieved easily using "drag and drop", but I need to automate the function. Thanks. Rob K7QJ _______________________________________________ PSDR mailing list PSDR@hamwan.org <mailto:PSDR@hamwan.org> http://mail.hamwan.net/mailman/listinfo/psdr _______________________________________________ PSDR mailing list PSDR@hamwan.org <mailto:PSDR@hamwan.org> http://mail.hamwan.net/mailman/listinfo/psdr -- Thanks, Jamie Owens _______________________________________________ PSDR mailing list PSDR@hamwan.org <mailto:PSDR@hamwan.org> http://mail.hamwan.net/mailman/listinfo/psdr
participants (5)
-
Bart Kus -
Jamie Owens -
Rob Martin -
Stephen Kangas -
Tom Hayward