Community discussions

MikroTik App
 
vanikcz
newbie
Topic Author
Posts: 36
Joined: Wed Oct 14, 2015 11:06 pm

Read contents of rsc file

Tue Jan 04, 2022 2:06 am

Hi there!
is there any way to read file with rsc extension? I tried:
 :global fileContents [/file get current.rsc contents];
but the variable is then empty. If I try to read another, for example txt file, contents are loaded successfully.

Tried on 6.49 and 7.1.1

Basically I want to get current configuration to a variable. Is this somehow possible?

Best regards, Jan
 
vanikcz
newbie
Topic Author
Posts: 36
Joined: Wed Oct 14, 2015 11:06 pm

Re: Read contents of rsc file

Wed Jan 05, 2022 9:22 am

Finally i found that /file get ... contents can work with files up to 4kB. If the file is bigger, function returns empty result.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3297
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Read contents of rsc file

Wed Jan 05, 2022 9:52 am

After you get config inn to an variable, who would you then use it from there, to what?
 
vanikcz
newbie
Topic Author
Posts: 36
Joined: Wed Oct 14, 2015 11:06 pm

Re: Read contents of rsc file

Wed Jan 05, 2022 10:12 am

After you get config inn to an variable, who would you then use it from there, to what?
I want to send it via /tool fetch HTTPS to my webservice for backup.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3297
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Read contents of rsc file

Wed Jan 05, 2022 8:24 pm

I do recommend SFTP instead.

Who is online

Users browsing this forum: Jonty, netmas, Semrush [Bot] and 22 guests