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

Re: [K12OSN] HELP!!!



Todd O'Bryan wrote:
[deletia]
> In addition, could someone point me to a good program that will
> take a snapshot of my working system in case this happens again.

Look into rsync + ssh + cron.

> Also, I have a backup of the home directory from two weeks ago...if
> I re-create all my users and copy the home back over, should that
> work reasonably well?

You have to be careful about the user id's.  When you copy the files
back over, they will have the old user ids.  If those aren't the same as
the new user ids, then George's files will be owned by Ringo.  There are
two ways to fix this.

1) Make sure everyone has the same uid as before when you create their
accounts
2) Change file ownership after restoring them.

I think option 2 might be easier.  Here's a crude bash script that'll do
it:
================BEGIN SCRIPT ===============================
for luser in `cat lusers | gawk '{ print $1 }'`
do
        echo $luser
        chown -R $luser.$luser ~$luser
done
================END SCRIPT ===============================

Before you run this, you should "cp /etc/passwd lusers" and then edit
lusers to weed out all the system userid's (i.e., get rid of root,
operator, et al).  Someone more clever than I could (and is encouraged
to) come up with something to use /etc/passwd directly - maybe looking
for uids >= 500?

-- 
Jim Thomas            Principal Applications Engineer  Bittware, Inc
jthomas bittware com  http://www.bittware.com          (703) 779-7770
Nothing is ever so bad that it can't get worse. - Calvin





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