Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] The Mother of All (bash) Commands
- Date: Mon, 17 Mar 2008 13:22:13 -0500
- From: "Daniel A. Ramaley" <daniel.ramaley@example.com>
- Subject: Re: [tlug] The Mother of All (bash) Commands
- References: <op.t756gdbtp3esx5@mail.gol.com> <20080317174630.ae60fceb.gstewart@bonivet.net>
- User-agent: KMail/1.9.5
On Monday 17 March 2008 12:46, Godwin Stewart wrote: >On Tue, 18 Mar 2008 01:51:39 +0900, "Greg Thomson " <gregt@example.com> wrote: >> Here is a cool little bash one liner with explaination. > >Been using just that to back up MySQL data and websites off remote > servers for yonks. I've been using something similar for some time as well. Closely related is a fast and easy way to copy directory trees while preserving permissions: (cd /src ; tar -cf - .) | (cd /dst ; tar -xvpf -) Of course, the "." argument to tar may be modified as necessary... That even works though an ssh pipe: (cd /src ; tar -cf - .) | ssh user@example.com '(cd /dst ; tar -xvpf -)' Or the other way: ssh user@example.com '(cd /src ; tar -cf - .)' | (cd /dst ; tar -xvpf -) Depending on the situation, rsync might be better. For a 1-time copy running tar through a pipe is usually faster, though. I've used it to migrate data. I suppose it would even be possible to copy between 2 remote machines, with all the data piped through the local machine. In most situations that would not be an efficient use of bandwidth or CPU time, but i'd imagine it has been done before. Perhaps with the local machine being a firewall or router or something that can see both of the other hosts when they can't see each other. I've never done it before, but this *should* work: ssh user1@example.com '(cd /src ; tar -cf - .)' | \ ssh user2@example.com '(cd /dst ; tar -xvpf -)' ------------------------------------------------------------------------ Dan Ramaley Dial Center 118, Drake University Network Programmer/Analyst 2407 Carpenter Ave +1 515 271-4540 Des Moines IA 50311 USA
- Follow-Ups:
- Re: [tlug] The Mother of All (bash) Commands
- From: Joe Larabell
- References:
- [tlug] The Mother of All (bash) Commands
- From: Greg Thomson
- Re: [tlug] The Mother of All (bash) Commands
- From: Godwin Stewart
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] The Mother of All (bash) Commands
- Next by Date: [tlug] Wordpress Spam
- Previous by thread: Re: [tlug] The Mother of All (bash) Commands
- Next by thread: Re: [tlug] The Mother of All (bash) Commands
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links