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:
- wget ftp://ftp.ncftp.com/ncftp/ncftp-3.2.5-src.tar.bz2
- tar xfj ncftp-3.2.5-src.tar.bz2
- cd ncftp-3.2.5
- ./configure
- make
- make install
- mkdir /root/.ncftp
- 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 INFOcase "$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.