Page 1 of 1

Nightly Backups via FTP Server

Posted: Wed Sep 14, 2011 9:57 pm
by wispwest
Is there a way to program the mikrotiks to FTP into a server every night and backup the files? Many years ago the people than ran my company had it setup that way with the mikrotik software actually running on PC's, but is it possible to do so with routerboards?

Some of these Mikrotiks have 300+ queues now and having over 40 mikrotiks makes weekly manual backing up a pain!

Re: Nightly Backups via FTP Server

Posted: Wed Sep 14, 2011 10:25 pm
by fewi
Whatever you had working with servers would also work with RouterBOARDs. Same OS, after all.

The simplest thing to do would be to set up SSH keys for local users. Then you can use OpenSSH in a scripted fashion without a password prompt to first generate the backup, and then use scp to transfer it over.

Here's an example: http://forum.mikrotik.com/viewtopic.php?f=9&t=54930

Re: Nightly Backups via FTP Server

Posted: Wed Sep 14, 2011 10:29 pm
by wispwest
ok thanks, now is there anyway to make it automatically FTP and backup at a certain time every day? that would defeat the whole purpose if it cannot be automatically done....

thanks for any info

Re: Nightly Backups via FTP Server

Posted: Wed Sep 14, 2011 10:35 pm
by fewi
Well, yeah. Since those commands can run unattended you can schedule them. Via whatever scheduling mechanism the host pulling the backups has. On *nix you'd probably use cron.

Just to clarify: I'm talking about the other way around. A server PULLS files from the router.

If you want to push files just write a script that first runs a backup and then uses "/tool fetch" to upload it via FTP (http://wiki.mikrotik.com/wiki/Manual:Tools/Fetch). That will require you to run 5.x code.

Edit: generally pull backups are better than push backups. In a push backup the server that will receive the files must be accessible via the network - not good for storing things as confidential as router configurations. Also the client needs write rights to upload the file. Conversely in a pull backup the server only has to establish an outbound connection, and the client doesn't have to have any access to the server at all.

Re: Nightly Backups via FTP Server

Posted: Sat Sep 17, 2011 1:06 am
by Alqatife
Hi,

Here's an script use "/tool fetch" to upload it via FTP :D http://forum.mikrotik.com/viewtopic.php?f=9&t=52371

Useful script for Automatic backup for System + UserManagerDB ...
Daily... new file name by time and date!!!
Daily... upload to External FTP!!!
Daily... Clean!!! Save the space ... No duplicate in Mikrotik!!!

Re: Nightly Backups via FTP Server

Posted: Mon Sep 19, 2011 10:34 am
by janisk
indeed, fetch got some love some time ago (not long time ago) and is capable of uploading files.