Backup from FTP Server to NAS?

Status
Not open for further replies.

serutech

Cadet
Joined
Jul 17, 2013
Messages
3
Hi guys,

I'm running a FreeNAS 8.2.0. I need to backup a folder from an FTP server (with quite some data in it) to the NAS system and don't really know how to do this. The server and the NAS are both in remote locations. Is Rsync capable of doing that job? Or does anyone have another solution?
Help would be great!

Cheers
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
rsync is its own protocol. It won't work with FTP.

I'd look at creating a script to automatically upload changed files via FTP or using rsync on both NASes.
 

serutech

Cadet
Joined
Jul 17, 2013
Messages
3
Thanks for your reply cyberjock,
the problem is, that the server I want to backup isn't a NAS. But the support of the provider told me, that rsync is possible over SSH. I'll look into that..
 

lorenzoASR

Dabbler
Joined
Nov 10, 2012
Messages
39
New solution:

Code:
!/bin/bash
HOST='yourFTPipORhost'
USER='username'
PASSWD='password'
DIR='directoryTOdownloadPATH/'
FILE='*'
# Login, run get files
ftp -inv $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd $DIR
mget $FILE
bye # Cleanup exit 0


You have to save this lines into a file called like "autoftpdownload.sh", then type "chmod +x autoftpdownload.sh" and try it with "./autoftpdownload.sh"

I tried it on my FreeNAS and it works, so, do your tests and add it in cron!

Bye
 

MarkT

Cadet
Joined
Aug 17, 2013
Messages
1
wget -r ftp://username:password@yourftpipaddress/directoryYOUwantTOdownloadFILES/*

I hope this will solve your problem!

UPDATE: sorry but this command works on debian, not in freebsd, i will post new solution soon

Hi lorenzoASR - with FreeNAS-9.1.0-RELEASE-x64 (dff7d13), wget works fine for me, at least from the shell prompt. I haven't tried from cron.

I'm using:

Code:
wget -rc -l 10 ftp://username:password@yourftpipaddress/directoryYOUwantTOdownloadFILES/*


to make sure I can resume downloads and reach the necessary depth in my directory tree.


If you want some rsync-like functionality such as checking file timestamps to update changes on the ftp server, you can use the wget --timestamp option.

Many other wget features, see here:

https://www.gnu.org/software/wget/manual/wget.html

Thanks for the solution lorenzoASR :)
 
Status
Not open for further replies.
Top