# dump && restore via FTP



## setevoy (Dec 26, 2012)

Hello, everybody!

Can somebody help with restore via _ftp_, plz?

So, I have backup-server. Access to it - only via FTP. I have dump file there. With this file everything OK - I can watch files in it etc.

Than, I make _newfs_ on machine, mount it to _/mnt_ and:

```
# restore rf | ftp ftp://user@backup.something.com/file.dump -
```

After download progress endinding - I don't have anything on my partition:


```
...
5656135680 bytes received in 14:58 (6.00 MB/s)
221-Goodbye. You uploaded 0 and downloaded 5523570 kbytes.
221 Logout.
frenzy:/mnt@[12] # ls
/bin/ls: Input/outpu erro.
frenzy:/mnt@[12] # df -h
Segmentation fault.
frenzy:/mnt@[12] # cd /
frenzy:/@[12] # file -s /dev/da
da0%   da0p1% da0p2% da0p3%
frenzy:/@[12] # file -s /dev/da0p2
Segmentation fault.
```

Any ideas - what I do wrong?

P.S. sorry for my English


----------



## wblock@ (Dec 26, 2012)

To have restore(8) read from stdin, the file has to be piped to it.

(Untested.)

```
# ftp ftp://user@backup.something.com/file.dump -o - | restore -rf -
```

The segmentation faults are worrying.  Unless those were caused by the failed restore, that needs to be fixed first.
Also, please, please stop using FTP.  sftp(1) is an easy replacement.  So are many other things that are less prone to compromise.


----------



## kpa (Dec 26, 2012)

I don't think that sftp(1) has an option to dump the file to stdout. The standard ssh(1) client is better suited for that 


`# ssh user@remote dd if=/somedumpfile | restore -rf  -`


Edit:

If you must use FTP, use fetch(1). It knows the FTP protocol and is generally more robust than the standard ftp(1) client.

`# fetch -o - [url]ftp://user@backup.something.com/file.dump[/url] | restore -rf  -`


----------



## setevoy (Dec 27, 2012)

kpa said:
			
		

> `# fetch -o - [url]ftp://user@backup.something.com/file.dump[/url] | restore -rf  -`



This one helped me! Thanks. System booting normally


----------



## wblock@ (Dec 27, 2012)

To mark as solved, edit the first post in the thread.  Go to Advanced mode and there's a dropdown before the title.


----------

