[Novalug] Re: weekly cron job

DonJr djr1952 at hotpop.com
Wed Jan 9 20:24:38 EST 2008


On Wed, 2008-01-09 at 19:22 -0500, Jay Hart wrote:
> Don,
> 
> Installed a debian version of the start-stop-daemon file, it works.
> 
> Now using 1.3.11.
> 
> But, chmod rw,r,r produces this:
> 
> chmod: invalid mode: `rw,r,r'
> Try `chmod --help' for more information.
> 
> I think I fix this, I'm good to do.
> 
> Jay

 Should of been:
    chmod u=rw,o=r,a=r /tmp/spamfiles

 {-: I keep forgetting that 'chmod' is a little long winded in it's
requirements for specs. :-}

OR the simple way of:
   chmod 0644 /tmp/spamfiles

All the line is doing is assuring that the user can the read the list of
file names.

BTW
  What distribution are you running anyway?

Did you try the '/bin/su' replacement version?

> > Another possible way is with '/bin/su', the commands would be
> something
> > like:
> >
> > CMD='/usr/bin/sa-learn --spam -f /tmp/spamfiles'
> > /bin/su - --command="${CMD}" $WHO || /bin/true
> >
> > And
> >
> > CMD="$(echo "find ${SPAMDIR} -type f -mtime +15 | xargs rm -f" )"
> > /bin/su - --command="${CMD}" $WHO || /bin/true
> >
> > # the "$(echo ...)" is to force the expansion of the varable
> SPAMDIR.
> >
> > # The '|| /bin/true' is because I have no idea what exit code su
> will
> > return, as it's undefined.
> >

-- DonJr


> > --
> >  DonJr





More information about the Novalug mailing list