beeyev / mikrotik-routeros-automatic-backup-and-update Goto Github PK
View Code? Open in Web Editor NEWScript sends backups to email and keep your mikrotik firmware up to date.
License: MIT License
Script sends backups to email and keep your mikrotik firmware up to date.
License: MIT License
The script doesn't update the firmware. I receive the message "If you have not received second email in the next 5 minutes, then probably something went wrong." and I don't receive the second mail and the firmware is not updated.
Hi!
Could you add uploading file backup via FTP/SFTP protocol? It would required the file name was unique so I suggest to add pattern to the file name like yyyy-MM-dd
or yyyy-MM-dd-hh-mm
.
if there is a minute, I propose to implement informing in telegrams
ros v7.1.3
From
:local backupFileConfig "$backupName.rsc";
To
:global backupFileConfig "$backupName.rsc";
From
:execute "/export compact show-sensitive terse file=$backupName";
To
:execute {/export compact show-sensitive terse file=$backupFileConfig;}
Or, how about drop "execute" and "wait"?
Please kindly review.
This is not a script error but some of my Mikrotics have "model: RouterBOARD cAP L-2nD" set and that is the problem.
I solved it like this:
#: local deviceRbModel [/ system routerboard get model];
: local deviceRbModel "RBcAPL-2nD";
every time I run it, I get the error "executing script BackupAndUpdate from winbox failed, please check it manually".
If I delete the marked lines, the script works again.
Mikrotik-RouterOS-automatic-backup-and-update/BackupAndUpdate.rsc
Lines 235 to 240 in 750f655
error
input does not match any value of channel
:local updateChannel "current";
:local updateChannel "stable";
RouterBOARD 941-2nD
Current Firmware 6.43.8
The file name for version 7.10.2 - v7.10.2_stable_-02202-0-053710.rsc
Receive the error message in the email:
Mikrotik couldn't get any information about new RouterOS from server!
I think this script is great.
When the script updates 7.11.2 to 7.12 the script becomes broken because one of the commands has been renamed.
Looking at this https://forum.mikrotik.com/viewtopic.php?t=201345
It states:
email - rename "address" property to "server"
Therefore to fix the script find the section of script below
#Check proper email config
:if ([:len $emailAddress] = 0 or [:len [/tool e-mail get address]] = 0 or [:len [/tool e-mail get from]] = 0) do={
:log error ("$SMP Email configuration is not correct, please check Tools -> Email. Script stopped.");
:error "$SMP bye!";
change the word address (after get) to server
Apply the script.
When updating from 7.11.2 to 7.12 the script failed. The routerOS was updated but the routerboard firmware was not.
I hope this helps someone!
There was an error while running the script. The log shows: 'executing script BackupAndUpdate from winbox failed, please check it manually"
There is still an issue with the hide-sensitive option, now in 7.1 the export always hide sensitive information by default, you have to use show-sensitive parameter to export those options too, i have manually changed my script in the export section.
Script not running on Mikrotik x86 .I think it is because /system routerboard command is empty on x86 (even no winbox menu). Or maybe somethong else...
After start in log view only the next line:
Bkp&Upd: script "Mikrotik RouterOS automatic backup & update" started.
Bkp&Upd: Script Mode: backup, forceBackup: false
Hi how easy would it be to add the current Public IP address to the email that is sent out.
http://ifconfig.co/ip
gives the Public IP Address
Something like the below ??
:local fetchdata [/tool fetch url="http://ifconfig.co/ip" output=user]
:local extip ($fetchdata->"data")
:local extip [ :pick [ :tostr "$extip" ] 0 [ :find "$extip" "
" ] ]
"IP updated to $extip!"
Please add new mode, example: osupdate over backup if there is an update
The system will backup only when there is an update and will be updated, as was the first version of the script
Прошу добавить новый режим, который будет работать так:
система сделает бэкап только когда есть обновление и обновится, как было в первых версиях скрипта
Firstly, thank you for your script!
This is not an issue.
Gmail conversation view was categorizing all the backups under the same subject as 1 email.
To bypass this I added/changed some code which I would like to share it here as it could be useful for someone who is searching the backups by date.
I added a new line:
:local devicedate [/system clock get date]
Then I edit,
From: :local mailSubject "$SMP Device - $deviceIdentityNameShort.";
To: :local mailSubject "$SMP Device - $deviceIdentityNameShort - $devicedate";
The final subject is now: Bkp&Upd: Device - - apr/26/2022 Backup was created.
I have a couple Model: RB941-2nD that I get *.rsc.in_progress files when the script runs as a scheduled job at 3:00 AM. Runs okay if I run it interactively. Or maybe watch for 'in_progress' in the filename and if it's there extend the delay.
Overall very useful script... thanks!
Hello
The script worked flawlessly until google removed the option to allow insecure apps option.
I put another smtp server but now I can't send the backup mail anymore:
Same error with both hotmail smtp and smtp2go smtp: invalid BODY
Help please..........
hi,
the current version does not work in ros 7.1
there seems to be an issue with sending an email. syntax changed?
thx!!
Error sending e-mail <Bkp&Upd: Device - MikroTik. No new OS updates. Backup was created.>: invalid BODY
Hello @beeyev.
Would it be possible to disable the "Auto backup before updating" feature?
I really don’t see the need for it if one is using the script often, like every second or third day.
If there are any problems with the new OS version, I can roll back to the previous version a few days back.
Thanks very much.
Clive.
Sometimes router goes offline and missed schedule backup time. So backup done next day at same as schedule and I lose backup for that day.
Is there any way to confirm backup if it is missed, so run backup script?
installed version 7.11.2;
maybe something change on the new version
7.12.
thanks for this script!
When in System -> Identity
contains comma (eg. CCR1016, Office1) scrip hangs with message
Bkp&Upd: could not send email message (succeeded). Going to try it again in a while.
Perhaps an additional check or (which is easier!) а naming recommendation will help here.
I get an error after RouterOS update in section: #Check proper email config
The expression [/tool e-mail get address] is not valid because of the "address" value
Look like is not longer valid value in that context. I changed to "user", but I am not sure if the meaning of values are similar.
Current RouterOS: 7.12.1
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.