mikrotik ssh export backup with mysql in perl debian lenny


FIrst of all you need to install dh-make-perl because we need some perl libs from cpan…
Now we install some libs:

dh-make-perl --build --cpan Net::SSH::Perl
dh-make-perl --build --cpan Net::SSH::Expect

dont forget to install the dependences for this libs you will need em… (they are printed to stdout @ compile)

install the libs with:

dpkg -i libblah.deb

when we’ve done this we make the mysql setup
it looks like this:

apt-get install mysql-server phpmyadmin

follow the installers instructions

here the database schema:

db: backup
                table: login
                                structure: routerip
                                structure: routeruser
                                structure: routerpass
                                structure: fehler
                table: backups
                                    structure: router
                                    structure: config
                                    structure: date

now let’s make some entry in database for a router to backup an run your script from cron…
(btw… iv’e startet this perl script in crontab with sudo… i had some env problems which I was too lazy to fix…)

http://www.paranoids … loads/backup.tar.bz2

Have fun!