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

Re: Preferred Backup Method?



On Wed, Dec 05, 2007 at 03:35:46PM -0800, David Brodbeck wrote:
>
> On Dec 5, 2007, at 3:16 PM, Michael Pobega wrote:
>> tar cvvf foo.tar bar | ssh user@dest "cat > foo.tar"
>>
>> Or am I doing it wrong (I most likely am)? I've never done any sort of
>> piping through SSH before, so any sort of help would be appreciated.
>
> You're close.  Try this:
>
> tar cvvf - bar | ssh -e none user@dest "cat >foo.tar"
>
> Using - as the filename tells tar to output to stdout.  "-e none" disables 
> SSH's escape character, making the session fully transparent -- otherwise 
> SSH will go into command mode if your tar output happens to contain a line 
> that starts with ~.
>

I am not able to test it out now, but I'd like to know if my script will
work.

The lines in question are:

aptitude search "~i!~M" | grep -v "i A" | awk '{print $2}' | ssh -e none $SSHUSER@SSHSERVER "cat >"$TIMEDIR/"aptitude.log"

$TAR -cvvf - /$FILE | ssh -e none SSHUSER@SSHSERVER "cat > "$TIMEDIR/$FILE.tar

-- 
If programmers deserve to be rewarded for creating innovative
programs, by the same token they deserve to be punished if they
restrict the use of these programs. 
 - Richard Stallman

Attachment: signature.asc
Description: Digital signature


Reply to: