Community discussions

MikroTik App
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Export in script bombing after update to 6.48.2

Fri May 28, 2021 8:01 pm

I have a RB750r2 and a RB750Gr3 that each have a script that creates a backup, export, and version listing. The three files are then sent off site for archive. This script is run by schedule every night. These have worked perfectly for years. A few weeks ago, both routers were updated to 6.48.2 and I realized this morning that the scripts were not completing. The last time that the scripts completed was the evening prior to updating the firmware to 6.48.2
The RB750r2 had been 6.48.0 and the RB750Gr3 had been 6.47.8. Both were updated to 6.48.2 the same day, and there were no changes to the scripts. Here is the beginning of the script for the RB750Gr3. I have done some testing with added log entries and have determined that the scripts are failing with the /export command. I have also determined that if I open a terminal window and enter the exact same text, the export command works properly. I have tried the export command both with and without an = between file and the desired filename. Either works in a terminal window, but neither works in the script. If I remark out the export command, the remainder of the script works properly.
# Policies needed:  ftp, read, policy, sensitive, test
# Policies NOT needed:  password, reboot, write, sniff, romon
:log info "Starting daily backup";
/system backup save name=RB750Gr3-1_Daily
/export file RB750Gr3-1_Daily
/system package print file RB750Gr3-1_Version.txt
The scripts continue with where I send the three files.

Any ideas?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Export in script bombing after update to 6.48.2

Fri May 28, 2021 10:10 pm

is very easy to find the right syntax if you omit the
=
two times
:log info "Starting daily backup"
/system backup save name=RB750Gr3-1_Daily
/export file=RB750Gr3-1_Daily
/system package print file=RB750Gr3-1_Version.txt
if you paste in terminal you must notice the black box where missing the =
Last edited by rextended on Fri May 28, 2021 10:18 pm, edited 3 times in total.
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

Re: Export in script bombing after update to 6.48.2  [SOLVED]

Fri May 28, 2021 10:14 pm

From the changelog:
*) console - require "write+ftp" permissions for exporting configuration to file;
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Export in script bombing after update to 6.48.2

Fri May 28, 2021 10:19 pm

It's possible to have the full export script, just for curiosity?

Some other methods for backup or for backup completly the Routerboard:
viewtopic.php?f=1&t=175360&p=858564#p858564
 
User avatar
k6ccc
Forum Guru
Forum Guru
Topic Author
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: Export in script bombing after update to 6.48.2

Fri May 28, 2021 10:37 pm

From the changelog:
*) console - require "write+ftp" permissions for exporting configuration to file;

Thanks!
That was it. I had not caught that in when I read the release notes.

And per the request, here is the full script:
# Policies needed:  ftp, read, policy, sensitive, test, write
# Policies NOT needed:  password, reboot, sniff, romon
:log info "Starting daily backup";
/system backup save name=RB750Gr3-1_Daily
/export file=RB750Gr3-1_Daily
/system package print file=RB750Gr3-1_Version.txt
:delay 00:00:01
/tool e-mail send file=RB750Gr3-1_Daily.backup to="<address redacted>" body="Router #1 daily backup file attached." \
   subject="RB750Gr3-1  $[/system clock get date] at $[/system clock get time]  Backup"
:delay 00:00:10
/tool e-mail send file=RB750Gr3-1_Daily.rsc,RB750Gr3-1_Version.txt,flash/log.0.txt to="<address redacted"" body="Router #1 daily script and version files attached." \
   subject="RB750Gr3-1  $[/system clock get date] at $[/system clock get time]  Script"
:log info "Daily backup script completed"
And Rextended, it does work either with or without the = before the filename, but I did add them...
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Export in script bombing after update to 6.48.2

Fri May 28, 2021 11:18 pm

thanks,

the curiosity are about RB750Gr3-1_Version.txt

now understand
:)))


you check if without password rigth save the passwords on exports?
it's a bug if it do that, better you set also password rigth for future versions...
test is needed? :) ??

Who is online

Users browsing this forum: kevinlukas and 16 guests