[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vps-mail] Bayes --force-expire problem
- Subject: Re: [vps-mail] Bayes --force-expire problem
- From: Scott Wiersdorf <scottw@xxxxxxxxxxxx>
- Date: Thu, 29 Apr 2004 16:11:22 -0600
On Thu, Apr 29, 2004 at 05:55:26PM -0400, Jim Smith wrote:
> For anyone else with a similar problem to this, I figured I'll share the
> solution. It was triggered from Abigail and Scott's discussion on
> permissions. When I log in as root and run sa-learn --force-expire, it does
> the expire as it is suppose to. However, because I'm logged in as root, it
> naturally leaves the owner as root instead of jimsmith. If I had changed it
> back from root to jimsmith, I'm sure it would have been fine. However, now I
> know for next time.
Here's a little shell script you could run to expire a list of users:
<snip>
#!/bin/sh
for user in joe bob sally; do su -m $user -c "sa-learn --force-expire"; done
</snip>
The 'su -m $user' drops privileges to that userid (as if you had
logged in as them, even if they don't have shell access).
You could put that in a file and run it from cron once in a while.
That way you won't get the root problems if you forget to chown their
file back.
Scott
--
Scott Wiersdorf
scottw@xxxxxxxxxxxx
======================================================================
This is <vps-mail@xxxxxxxxxxxx> <http://www.perlcode.org/lists/>
Before posting a question, please search the archives (see above URL).
Main Index |
Thread Index