How to: Backup to FTP with NCFTP

Showing an easy way of copying your files to an remote FTP Server.

Install ncftpapt-get install ncftp

apt-get install ncftp

Create ncftp-serverconfig

/root/.ncftp/backupserver.cfg
host <server-ip/hostname>
user <username>
pass <password>

Create CronJob

/etc/cron.d/backup
40 2 * * *     root     ncftpput -f /root/.ncftp/backupserver.cfg -vZmRF /ftp-directory/ /local-backup/* 1>/dev/null

This way you will recieve warnings/errors.

Flags

-f <Filename> Serverconfig
-m try to create directory
-R recursivly
-v verbose progress
-Z enable PassivTransfer

Debugging

If something is going wrong, try to use the “-d <filename>” to enable debugging for more details.

Tips

To keep your BackupSpace clean you can also issue an delete command before uploading.
Simply add: -W “delete /directory/*”
Unfortunately you can’t delete recursivly, since it’s assuming rm as delete.

Bookmark and Share

Leave a Reply