You can use tar + rsh or ssh to copy a directory tree over the network:

server $ cd /dir_to_backup
server $ tar cf - . | rsh backupserver 'cd /backupdir && tar xf -'

if you have GNU tar you should do this:

server $ tar czBf - . | rsh backup 'cd /backupdir && tar xzBf -'

If you don't have the appropriate rsh .rhosts set up, or if it's not
permitted, then have the tar command create a tar file and ftp the file to
the backup server.  Of course, to untar the file on the backup server,
you'd have to use rsh anyway, or you could keep it as a tar file (if it's
zipped, it's much less space).

Good luck!
Luke

On Fri, 13 Jul 2001, Scherger, Susan M. wrote:

> Hello Fellow Perl Users:
> I'm trying to write a script that will go to a designated server and
> directory, check the age of each directory and if it is older than 3 days
> copy that directory and all of it's subdirectories to another server to be
> archived.
>
> I've succeeded in most of it, except copying the directory tree.
> Any suggestions would be most appreciated!
>
> Thanks
>
> Susan Scherger
> Unix System Administrator
> Eschelon Telecom, Inc.
> 612-436-6260 - Phone
> 612-436-6360 - Fax
>
> "The biggest cause of trouble in the world today is that the stupid
> people are so sure about things and the intelligent folks are so full
> of doubts."                                          -Bertrand Russell
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to