using ncftp-client for background ftp-transfers


I use for my ftp backups always ncftspooler. It´s a part of NcFTP Clients, which runs as a daemon und moves on request files to ftp-server.

The installation is very simple:

  1. wget ftp://ftp.ncftp.com/ncftp/ncftp-3.2.5-src.tar.bz2
  2. tar xfj ncftp-3.2.5-src.tar.bz2
  3. cd ncftp-3.2.5
  4. ./configure
  5. make
  6. make install
  7. mkdir /root/.ncftp
  8. mkdir /root/.ncftp/spool

To start ncftpspool simply enter

/usr/local/bin/ncftpspooler -d -q /root/.ncftp/spool/ -o /var/log/ncftpspool


The demon checks every 2 minutes for new queue-files in /root/.ncftp/spool. Those files could be created by a backup-script. The queue-files are simply text-files, so they can created “by hand” instead of using ncftpput.

On my system the spooler runs always, so i created /etc/init.d/ncftpspooler with the following content:


#!/bin/bash
#

### BEGIN INIT INFO
# Provides: ncftpspooler
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Spooler job for ncftp
### END INIT INFO

case "$1" in
'start')
/usr/local/bin/ncftpspooler -d -q /root/.ncftp/spool/ -o /var/log/ncftpspool
;;
'stop')
esac

make it executable

chmod 700 /etc/init.d/ncftpspooler

and add it to your boot-config

chkconfig –add ncftpspooler

And already, any backup scripts writes the ftp transfers in the spool directory, and can take care of the preparation of the next archive.

Leave a comment

Your email address will not be published. Required fields are marked *