Page 1 of 1

[Req] Script for Restoring Backup File (Configuration)

Posted: Wed Oct 22, 2014 10:21 am
by SaeedYa
Hi,
As far as I know, Mikrotik should be capable of doing automate restoring. The problem is I don't know how to implement it :(
I 'd appreciate if you help me out on this.

The scenario is simple and straightforward, I want to restore a configuration at specific time ( At 1 AM ) and revert back to main configuration ( at 8 AM)

I create 2 backup but I don't know How to make it automatic.
system backup load name=A1.backup 
system backup load name=B1.backup 
Thanks for sharing your knowledge.

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Thu Oct 23, 2014 7:28 am
by SaeedYa
Hi, Any idea ?

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Thu Oct 23, 2014 9:19 am
by bajodel
system scheduler ..set date start and period ..and then put your commands..

anyway, I think it's really heavy and unreliable doing that 365x2 / year ..are the two config so different?? you can change on schedule only the differences!

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Thu Oct 23, 2014 10:45 am
by SaeedYa
system scheduler ..set date start and period ..and then put your commands..

anyway, I think it's really heavy and unreliable doing that 365x2 / year ..are the two config so different?? you can change on schedule only the differences!
Hi,
You guess right, They are totally different. I put this code
system backup load name=A1.backup 
into scheduler and it didn't work. How can I implement "Enter" in scheduler ?

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Thu Oct 23, 2014 1:58 pm
by bajodel
system scheduler ..set date start and period ..and then put your commands..

anyway, I think it's really heavy and unreliable doing that 365x2 / year ..are the two config so different?? you can change on schedule only the differences!
Hi,
You guess right, They are totally different. I put this code
system backup load name=A1.backup 
into scheduler and it didn't work. How can I implement "Enter" in scheduler ?

put "/" before command ..
/system backup load ..

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Thu Oct 23, 2014 5:16 pm
by SaeedYa
system scheduler ..set date start and period ..and then put your commands..

anyway, I think it's really heavy and unreliable doing that 365x2 / year ..are the two config so different?? you can change on schedule only the differences!
Hi,
You guess right, They are totally different. I put this code
system backup load name=A1.backup 
into scheduler and it didn't work. How can I implement "Enter" in scheduler ?

put "/" before command ..
/system backup load ..
I did as you said, and run it but nothing happened !
/system backup load name=A1.backup 

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Fri Oct 24, 2014 4:30 am
by bajodel
test commands from cli, put it into two system/scripts (give full permissions ..use two different names)..then create two schedule launching (run) your scripts (names)

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Fri Oct 24, 2014 12:33 pm
by SaeedYa
test commands from cli, put it into two system/scripts (give full permissions ..use two different names)..then create two schedule launching (run) your scripts (names)
Believe me, I have tried this many times, and every time stucks at Password step.
Lets go this time together.
/system script> add name=Profile-A1 policy= ftp,reboot,read,write,policy,test,password,sniff,sensiti
ve\ source="/system backup load name=A1.backup"
and then !
 /system script> run Profile-A1 
password: 

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Sat Oct 25, 2014 3:17 pm
by SaeedYa
No idea here ?

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Tue Oct 28, 2014 6:56 pm
by skot
Instead of using the "backup" option, export the router configuration, which saves a plain text file, which then can be imported to the router.

Export the configuration to a file:
/export file=myFile-A1
To apply this configuration, reset the router and run the script after reboot:
/system reset-configuration keep-users=yes no-defaults=yes run-after-reset=myFile-A1.rsc

Re: [Req] Script for Restoring Backup File (Configuration)

Posted: Tue Oct 28, 2014 7:56 pm
by SaeedYa
Instead of using the "backup" option, export the router configuration, which saves a plain text file, which then can be imported to the router.

Export the configuration to a file:
/export file=myFile-A1
To apply this configuration, reset the router and run the script after reboot:
/system reset-configuration keep-users=yes no-defaults=yes run-after-reset=myFile-A1.rsc
That's a novel Idea, Thanks a lot.