At 10:25 on 2003-02-01, raptor scribbled:
> I've started making a script to make a bakup of my configs.. simply
> scp-ing them from the remote computers, here arises two problems :
>
> 1. Permissions
> 2. Remote directory structure
>
I would suggest running a script as root on the other machines to tar
and gzip the files you want to back up. Then use chmod and chown so that
only the user you're logging in as can read it, and put it somewhere
consistent.
Client-side, you'd only need something like:
for all hostnames {
rm -rf /backups/$hostname.old
mv /backups/$hostname /backups/$hostname.old
scp $hostname:/path/file.tar.gz /tmp
if("tar -C /backups/$hostname -zxf /tmp/file.tar.gz" succeeds) {
rm /tmp/file.tar.gz
} else {
scream and maybe die, up to you
}
}
--
..: Chad Daelhousen == [EMAIL PROTECTED] :.........: sig v3.1 :...
: Programming for 11 +/- 2 years (52.4 +/- 9.5% of a lifetime) :
:.............Perl will be the first to implement mind reading.:
--
[EMAIL PROTECTED] mailing list