Tomato Router Config – Backup Script
Posted: March 18th, 2011 | Author: Gregg | Filed under: Linux, Tech | Tags: asus, backup, bash, cron, Linux, polarcloud, router, script, tomato, tomato cron backup, tomato router backup | 2 Comments »I recently was given the task to automate the backups of several remote routers that we manage that run tomato firmware.
Here is the Tomato developer’s site: www.polarcloud.com/tomato
The main goals were:
- To use https
- To be automated (Cron)’d later
- To scale from 1 to 1XXX routers
I tested it on Tomato Firmware 1.28 using my ASUS RT-N16 router, but it should work for any Tomato-firmware router.
There will be some slight modifications to run in cron, but let me know and I’ll be glad to help.
Download the .zip file here: tomatobackup1405
Extract the file so the full path will be /root/tomatobackup1405
Read the README inside the folder
chmod +x tomatobackup1405.sh
Add your hosts to the tomatobackup1405_hosts.cfg file
Run it!
If successful, you will see a subfolder with the date YYYYMMDD and the file with CoName-tomato_v
If there are connection problems, you’ll see an error message.
EDIT: There was a python rewrite by Sam@orgraphone.org
Feel free to check it out here
Let me know if you have any thoughts or suggestions.
-Gregg






Hi Gregg
I borrowed the ideas from this very useful script and rewrote it in python: http://org.orgraphone.org/2011/07/backing-up-tomato/
Thanks for the inspiration!
Sam
Hi,
Thanks for this, but I couldn’t get it working. I’m using Tomato 1.27 on an Asus RT-N16.
When I execute the curl command from the script file manually, I get
curl: (35) error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
Do you know what’s wrong? I enabled both http and https in tomato. I’m also aware of the python version and got this error:
IOError: [Errno socket error] [Errno 1] _ssl.c:499: error:14077417:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert illegal parameter
Please let me know if you have any suggestions. Thanks.