Posts

Showing posts from March 28, 2010

Mikrotik Backup through perl script

I don't know how many people are still using telnet but suppose if you are using this will help. Script uses export command to take the backup and save it. I thought better to share it. I'll check the ssh variation and upload when possible. #Date - 31st April 2010 #Gobinath #To retrive the backup from the mikrotik router. #!/usr/bin/perl use Net::Telnet; use POSIX ; #Input # routerlist contains ipaddress and name that save the backupfile seprated by tab # used for comments. #Backup Path. $path = "/mikrotik/backups"; #router List $filename = "routerlist.txt"; #Mikrotik Username Password +ct used to remove the color codes @username_list = ('admin+ct','admin'); @password_list = ('######','######'); #Read the router List open (FILE,$filename) ; #Time Stamp. my $datestamp = strftime("%Y%m%d",localtime); chomp($datestamp); sub retriver { undef @output ; my($username, $pass,$hostname) = @_; $telnet = new Net::Telnet (