using scp for a backup

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: der.hans
Date:  
Subject: using scp for a backup
Am 25. Jan, 2004 schw=E4tzte Lynn David Newton so:

> The problem is that the directory I'm copying has some
> symbolic links in it to places both inside and outside
> and outside that directory tree, including many places
> in my public_html Web development directory where I
> have links like img -> ../img and img -> ../../img and
> img -> ../../../img and so forth.


Use tar over SSH :).

TARC=3D"tar clvf - -C"
TARX=3D"tar x --atime-preserve -pvf -"

ssh -2 $HOST "/usr/bin/sudo $TARC ${fs} . 2>${RLOG}" | sudo $TARX >${LLOG} =
2>${LLOG}.err

Those are the 3 main lines in a really horrible backup script I have. You
might have to add some tar options to get the functionality you want. You
can do the same type of thing with cpio, but the --atime-preserve on the
destination will preserve timestamps on directories.

At this point it would be better to use the 'command' option with ssh to
limit what the backup process can run.

Maybe see if sftp will do what you need.

If you use sftp or scp see rssh.

rssh - Restricted shell allowing only scp and/or sftp

ciao,

der.hans
--=20
#  https://www.LuftHans.com/    http://www.AZOTO.org/
#  Very frankly, I am opposed to people being programmed by others.
#    -- Fred Rogers, aka Mr. Rogers (1928-2003)