[NTLUG:Discuss] Bash Scripting and permissions
    Ed Coates 
    edcoates at nighthawk.dyndns.org
       
    Sat Nov 30 11:53:36 CST 2002
    
    
  
Quoting Ed Coates <edcoates at nighthawk.dyndns.org>:
> 
> What he might try also is something that I just learned the other day.  You
> can 
> forgo the whole nfs mount and use tar through ssh to transfer it directly.  
> Here is a small script that I use to tar directly to a remote tape drive, 
> but 
> you can do the same thing to a file in a remote dir.
> 
> for ii in boot etc var home usr/local
> do
> tar --rsh-command=/usr/bin/ssh zcvf nighthawk:/dev/nst0 ${ii}
> done
> 
> This works seemlessly if you have the /root/.ssh/authorized_keys2 file 
> populated with the correct keys.
> 
> You can substitute the tape drive above with your path and filename of the 
> archive.
> 
> Hope that this helps.
> 
> Ed
> 
That's what I get for typing from memory.  :)  This should be the line
tar --rsh-command=/usr/bin/ssh zcvf nighthawk:/dev/nst0 /${ii}
without the / it won't pick up the full path for all the dirs.
Ed
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
    
    
More information about the Discuss
mailing list