#1  
Old 8th July 2008, 12:14
quentin quentin is offline
Junior Member
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Question dd over sftp

Hi,

Wondering if someone can help me out with this one:

I want to make disk images of a server and store them somewhere remote.

Ofcourse you can do this with dd and upload the file with sftp to a remote server. The downside is that it requires a huge amount of free space to store the temporary disk image file.

Is there a way to "stream" it directly to a sftp-server?

As far as I came up with was this:

dd if=/dev/sda | bzip2 > /backup/disk.img | sftp -b /backup/dd.txt
-oIdentityFile=/backup/sshkey.key remoteuser@remoteserver.com

contents of dd.txt:
-cd remotebackup
put /backup/disk.img
quit

In this case it will store the disk.img locally first and then send it. So I was wondering if there was an easier way to this and stream it directly.
(Note: The remote SFTP-server is a Windows-machine, so no linux shell commands can be executed)

Thanks in forward for any help.


Best regards,

Quentin
Reply With Quote
Sponsored Links
  #2  
Old 8th July 2008, 13:25
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

You could do that with a combination of dd and nc
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #3  
Old 8th July 2008, 13:26
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

PS: My bad you possible need to run over an encrypted tunnel which nc will not support.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #4  
Old 8th July 2008, 13:39
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

Am not sure if sftp can accept stdin but it is worth trying
Code:
dd if=/dev/sda | bzip2 > /backup/disk.img | sftp user@host:file -
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #5  
Old 8th July 2008, 16:16
quentin quentin is offline
Junior Member
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Won't work

Thanks for your reply, but with the last command you wrote it still will write to a local disk, which results in a huge "temp" file...

Still couldn't find a solution, but thanks for thinking along with me in this case.

Best regards,

Quentin
Reply With Quote
  #6  
Old 9th July 2008, 10:51
burschik burschik is offline
Junior Member
 
Join Date: May 2008
Posts: 24
Thanks: 0
Thanked 2 Times in 2 Posts
Default

The OpenSSH scp/sftp commands refuse to transfer non-regular files, so you can not use a named pipe. However, there are other scp/sftp implementations. Maybe one of them will do what you want.
Reply With Quote
  #7  
Old 9th July 2008, 14:19
quentin quentin is offline
Junior Member
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ok

Ok thanks for your replies.

In short: It just can't be done this way...

Does anyone know another program which can do the trick? I just want to image the disk on the fly to a remote server.

If any other backupsoftware can do something similar, it's ok too.


Best regards,

Quentin
Reply With Quote
  #8  
Old 9th July 2008, 15:09
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

You might want to take a look at SystemImager. It uses rsync to store the images on a remote server.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 23rd September 2008, 12:58
lintoolman lintoolman is offline
Junior Member
 
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by topdog View Post
PS: My bad you possible need to run over an encrypted tunnel which nc will not support.

Cryptcat could be used in leu of nc for an encryted tunnel.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with 'Chrooted SFTP With MySecureShell On Debian Etch' rupat Installation/Configuration 2 27th September 2007 03:31
(S)FTP and the "ftp-root" vogelor Installation/Configuration 5 8th January 2007 17:28
ISPConfig and SFTP vogelor Installation/Configuration 10 8th January 2007 14:14
Lock SFTP user into home dir in samba environment papaqube Server Operation 4 2nd May 2006 20:42
sftp acess for Web users anuragj Installation/Configuration 2 6th February 2006 23:41


All times are GMT +2. The time now is 07:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.