LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2015, 04:44 PM   #1
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Rep: Reputation: Disabled
Named pipes through the internet?


I have a need to backup a database on a system where there is not enough filesystem storage for the backup. The idea now is to dump the database to a named pipe on host1, have that cross the internet to host2 where I can read from another named pipe and write to a filesystem.

So, I basically need to write to a named pipe on one host and read from a named pipe on the second host.

Looking for ways/methods/examples of how I can do this.
 
Old 04-10-2015, 05:12 PM   #2
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
Not sure about pipes but I prefer to use remote fs mount over ssh with sshfs
 
Old 04-10-2015, 05:29 PM   #3
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
Open to options, but the 2 hosts are seperated by distance and the link is not great, so I would be worried about begin able to sustain a mount.
Anyhow, I could use instruction on how to do this method also, since I don't know.
 
Old 04-10-2015, 05:54 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
If it can't sustain a mount, how is it going to sustain a pipe (tcp/ip socket?)?

Your best bet is probably just to rsync over ssh.
Code:
rsync -av /path/to/source/dir/ user@IP:/path/to/backup/dir/
If the connection hangs/drops, just run it again and it'll pick up where it left off.
 
Old 04-10-2015, 07:38 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by usao View Post
So, I basically need to write to a named pipe on one host and read from a named pipe on the second host.
As in 'mysql destination.sql < <(ssh host "mysqldump source")'?
 
Old 04-10-2015, 09:05 PM   #6
kmhuntly
Member
 
Registered: Mar 2015
Location: Cheektowaga, NY
Distribution: ArchLinux
Posts: 34

Rep: Reputation: 7
Named pipes through the internet?

not sure what you're trying to do, but if its mysql you could just SSH to the host with a tunnel -

ssh -qtl username -L localport:localhost:remoteport hostname

and then

mysql -h localhost -p localport -u user -P
 
Old 04-11-2015, 03:45 AM   #7
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
As for mount FS other ssh: sshfs user@remote_host:/path /path
 
Old 04-11-2015, 02:19 PM   #8
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
For stability is there a way you could add a cheap box or external HDD to give you enough space to run mysqldump and then use rsync to the offsite location?


travis
 
Old 04-11-2015, 02:51 PM   #9
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
If it can't sustain a mount, how is it going to sustain a pipe (tcp/ip socket?)?

Your best bet is probably just to rsync over ssh.
Code:
rsync -av /path/to/source/dir/ user@IP:/path/to/backup/dir/
If the connection hangs/drops, just run it again and it'll pick up where it left off.
The point is that the source system doesn't have enough space to dump the DB locally, so I have to dump directly to a remote host.
 
Old 04-11-2015, 02:58 PM   #10
usao
Member
 
Registered: Dec 2011
Location: Chandler, AZ
Posts: 286

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
As in 'mysql destination.sql < <(ssh host "mysqldump source")'?
It a Sybase IQ database. Sybase has the ability to dump to a device or a file, and I have used named-pipes previously as a way to dump directly to 'gzip', but we don't have the option to install a external drive or add storage since the data contains sensitive personal information which wouldn't pass an audit. We can use encrypted channels though, which is why I thought dumping through a named pipe would work because we can layer encryption through the pipe easily enough.
 
Old 04-12-2015, 05:29 AM   #11
Nemesiz
Member
 
Registered: Oct 2007
Posts: 47

Rep: Reputation: 2
I suggest you to use SSH. SSH is already encrypted and mounted you can directly dump to it as locally.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
named pipes on CD romagnolo Linux - General 2 12-22-2011 06:28 PM
problems using named pipes shayke23 Linux - Software 2 08-13-2009 12:18 AM
Named pipes and C jobless Programming 2 10-21-2008 01:31 PM
named pipes lamtab Programming 12 12-11-2007 10:44 AM
Use of Named Pipes casey0999 Linux - Software 3 08-03-2003 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration