Page 1 of 1

Copy script source into scheduler

Posted: Fri Aug 13, 2010 11:28 pm
by ejmerkel
Is there a way to copy the script source from a file that's been ftp'd or scp'd to device into the script scheduler? I have a large number of devices I want to copy a script to and then schedule to run.

Is my only option to use
/sys script add name=test source="SOME HUGE AMOUNT OF TEXT"
Eric

Re: Copy script source into scheduler

Posted: Sat Aug 14, 2010 9:14 am
by changeip
from the router you developed the script on just run /system script export. then copy the piece you need and make a text file with it. then upload it with extension .rsc.auto (or .auto.rsc or whatever) and it will auto execute - and add your script.

Re: Copy script source into scheduler

Posted: Wed Feb 15, 2017 6:19 am
by jpil
Thread is old but posting here since google may lead someone here in the future...

if your text is in scripts/foo.rsc and you want to create a script called myscript:
/system script add name=myscript source=[/file get scripts/foo.rsc contents]
This will evaluate the potion in the braces which produces the content of the file and use that content as the value for source. Once you have the script "registered" you can use the /system scheduler to invoke it, etc.

-jp