Using ncftpget for automated FTP backups…

April 5, 2012 · Posted in Geekness 

So I like to use Mikrotik routers for moving bits around my networks and the Internet. In an effort to ensure I always have an off-host backup available, I’ve setup a backup process using ncftpget. I won’t cover how to setup cron jobs, hopefully you already know how to set one up. That said, this is a pretty simple setup.

I have my backups process nightly, at midnight. Here is a sample command syntax for my 750G called Gatekeeper:

cd /home/mikrotik/Gatekeeper_RB750G && /usr/local/bin/ncftpget -f ../.netrc_gatekeeper ./ /*.backup

The first part of the command drops you into your storage directory. The second part tells ncftpget to use the server and login information contained within the file .netrc_gatekeeper and to download any files matching the *.backup wildcard. You can change this to suit your needs.

Here is an example of how your .netrc file should look like:

machine 'IP/hostname'
user your_ftp_username
pass your_ftp_password

Note: You’ll need to create a separate .netrc file for each host you want to backup. Hence, my naming scheme of .netrc_hostname.

Here is a second command syntax example for my 493AH called Keymaster:

cd /home/mikrotik/Keymaster_RB493AH && /usr/local/bin/ncftpget -f ../.netrc_keymaster ./ /*.backup


Comments are closed.

  • Randoms


    Views: 1411

  • Latest Geek MPG

  • Phoenix