Community discussions

MikroTik App
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

[Req] Script for Restoring Backup File (Configuration)

Wed Oct 22, 2014 10:21 am

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.
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

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

Thu Oct 23, 2014 7:28 am

Hi, Any idea ?
 
User avatar
bajodel
Long time Member
Long time Member
Posts: 545
Joined: Sun Nov 24, 2013 8:30 am
Location: Italy

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

Thu Oct 23, 2014 9:19 am

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!
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

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

Thu Oct 23, 2014 10:45 am

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 ?
 
User avatar
bajodel
Long time Member
Long time Member
Posts: 545
Joined: Sun Nov 24, 2013 8:30 am
Location: Italy

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

Thu Oct 23, 2014 1:58 pm

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 ..
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

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

Thu Oct 23, 2014 5:16 pm

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 
 
User avatar
bajodel
Long time Member
Long time Member
Posts: 545
Joined: Sun Nov 24, 2013 8:30 am
Location: Italy

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

Fri Oct 24, 2014 4:30 am

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)
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

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

Fri Oct 24, 2014 12:33 pm

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: 
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

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

Sat Oct 25, 2014 3:17 pm

No idea here ?
 
User avatar
skot
Long time Member
Long time Member
Posts: 586
Joined: Wed Nov 30, 2011 3:05 am

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

Tue Oct 28, 2014 6:56 pm

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
I don't need any karma... I have Ιησους Χριστος!
 
SaeedYa
just joined
Topic Author
Posts: 17
Joined: Fri Jan 14, 2011 9:01 am

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

Tue Oct 28, 2014 7:56 pm

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.

Who is online

Users browsing this forum: No registered users and 21 guests