Import Script fails on line that does not exist

I have 2 CCR’s that I’m trying to keep the configs in sync with each other. One is the primary unit, and the other is a backup unit that is off most of the time.

I first tried to take a backup of the first CCR, then download the .backup file to my machine → power on the backup unit, plug my computer into it → upload the backup file → restore backup. This resulted in the secondary unit booting, but taking a long time. After about a minute of being on, it would reboot itself.

So I reset the configuration via the LCD and am now trying to import a .rsc script which is a full export from the primary CCR via /export file=myscript

I uploaded the script to the backup CCR, then via the terminal did an import myscript.rsc

It tells me there is a syntax error on line 323 column 7, however when I open the script file via Notepad++, the last line with a command on it is line 321, and 322 is a blank line. There is no line 323. The script does look complete as far as I can tell…

Any ideas?

both are CCR1009-8G-1S-1S+ running v6.21.1 on firmware 3.19

I"ll post the script file if someone thinks it will be helpful – however it is just a regular export to .rsc and looks complete as far as I can tell…

hmm… so after some further experimenting, it seems configuring

/system ntp client
set enabled=yes server-dns-names=0.us.pool.ntp.org,1.us.pool.ntp.org

in the script may have been causing some trouble since I was doing this without being plugged into the WAN. I tried doing the restore of the .backup from the main box with the secondary wan plugged in, yet it still did the reboot loop (I saw once something about watchdog timer, but didn’t get to investigate fully).

I ended up trying to copy-paste the script into the terminal, and everything went ok until it got down to the ntp settings, which caused it to reboot as soon as I hit enter.

so, i edited the .rsc script to comment out the ntp section, re-uploaded to the router, then did a normal import from the terminal. this time it worked well with on errors.

Weird.