Community discussions

MikroTik App
 
wispwest
Member
Member
Topic Author
Posts: 479
Joined: Tue May 19, 2009 3:48 am

Nightly Backups via FTP Server

Wed Sep 14, 2011 9:57 pm

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!
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Nightly Backups via FTP Server

Wed Sep 14, 2011 10:25 pm

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
 
wispwest
Member
Member
Topic Author
Posts: 479
Joined: Tue May 19, 2009 3:48 am

Re: Nightly Backups via FTP Server

Wed Sep 14, 2011 10:29 pm

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
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Nightly Backups via FTP Server

Wed Sep 14, 2011 10:35 pm

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.
 
Alqatife
just joined
Posts: 14
Joined: Wed Jun 02, 2010 3:40 pm

Re: Nightly Backups via FTP Server

Sat Sep 17, 2011 1:06 am

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!!!
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Nightly Backups via FTP Server

Mon Sep 19, 2011 10:34 am

indeed, fetch got some love some time ago (not long time ago) and is capable of uploading files.