Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Remote Backups and Command Line Stuff



On Fri, 07 Jul 2006 12:39:10 +0900, Scott VanDusen
<Scott_VanDusen@example.com> wrote:

> #!/bin/bash
>  
>  # this tars up joe's home directory into myhome.tar.gz tarball. 
>  /bin/tar -zcpf /home/joe/myhome.tar.gz /home/joe
>  
>  # This sends the tarball to the remote directory
>  cat /home/joe/myhome.tar.gz |ssh remotemachine "cd backup; cat >
> backup.tar.gz"

There's a way to do it that doesn't involve wasting space with a local
tarball:

tar -zcp /home/joe | ssh remotemachine "cd backup; cat > backup.tar.gz"

The output of tar is piped stright into ssh instead of making a tarball
with it and pipint *that* through ssh. I do this frequently.

-- 
G. Stewart - godwin.stewart@example.com

Hurewitz's Memory Principle:
    The chance of forgetting something is directly proportional
    to ..... to ........ uh ..............

Attachment: pgpeQMiu4z2Yv.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links