Community discussions

MikroTik App
 
Detoss
just joined
Topic Author
Posts: 1
Joined: Thu Mar 24, 2022 6:47 pm

.auto.rsc Not executing after Fetch

Thu Mar 24, 2022 7:02 pm

Below is what is inside the .auto.rsc - So far it it just puts the file into the file system but doesn't change the current script to this new value. It looks like it grabs the file but doesnt implement anything. Is there something I am missing?

## update.auto.rsc
/system script set number=0 source="# automated backup 2 External ftp\r\
\n\r\
\n# ftp configuration\r\
\n:local ftphost \"backup123.com\"\r\
\n:local ftpuser \"backups\"\r\
\n:local ftppassword \"Mtpass\"\r\
\n:local ftppath \"backup\"\r\
\n\r\
\n# months array\r\
\n:local months (\"jan\",\"feb\",\"mar\",\"apr\",\"may\",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\");\r\
\n\r\
\n# get time\r\
\n:local ts [/system clock get time]\r\
\n:set ts ([:pick \$ts 0 2].[:pick \$ts 3 5].[:pick \$ts 6 8])\r\
\n\r\
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: .auto.rsc Not executing after Fetch

Thu Mar 24, 2022 7:35 pm

auto.rsc is auto executed only when uploaded with FTP
https://wiki.mikrotik.com/wiki/Manual:C ... tic_Import
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: .auto.rsc Not executing after Fetch

Thu Mar 24, 2022 7:39 pm

I suggest you to automate the fetch of the .rsc on remote server (or another mikrotik device) and executing it after download inside routerboard.
Is how I manage all the thousand of the CPE. I just upload a file on one folder and on scheduled base the CPE fetch the file and (after some script health checking...) run the script
 
tabate47
Long time Member
Long time Member
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: .auto.rsc Not executing after Fetch

Mon May 09, 2022 7:05 am

Rex,

I would like to be able to add a script to an FTP folder on my computer, and have all of my routers check in every night to see if there is a file in the FTP folder. If there is a file, the routers should download and execute it. In reading this post I realize you cannot auto-execute a downloaded script.

What is the best way to accomplish this?

I want to be able to update and make changes to all of my routers in bulk, and this idea seems to be the best way to do this so I don't have to log into each router which would take forever.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: .auto.rsc Not executing after Fetch

Mon May 09, 2022 10:23 am

These things must be thought about before the machines become hundreds...
You have to create a "shared folder" and more than on the computer it must be put on a "server", which if the computer is off, is reachable anyway.
And then the server is done on purpose, instead the computer has various problems that I am not going to list now.
For example, you can read one file by https from your server, but when is downloaded,
you already know the file name and is possible to run / import it directly instead of using autoruns.

Who is online

Users browsing this forum: marcelofares and 16 guests