[Novalug] Re: weekly cron job
Jay Hart
jhart at kevla.org
Wed Jan 9 19:22:22 EST 2008
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
> On Tue, 2008-01-08 at 22:32 -0500, Jay Hart wrote:
>> > /sbin/start-stop-daemon -start --pidfile /dev/null --startas
>> /usr/bin/sa-learn
>> > --oknodo --chuid $WHO -- --spam -f /tmp/spamfiles
>>
>> Feeding this as one line gives same error.
>>
>> >> > email:/etc/cron.weekly # ./spam-learn
>> >> > /sbin/start-stop-daemon: --signal takes a numeric argument
>> >> > Try `/sbin/start-stop-daemon --help' for more information.
>>
>> I think the --startas option is the problem.
>>
>> -s is signal, and a num value is expected.
>
> See my private email to you.
> You are running a VERY VERY OLD version of start-stop-daemon
>
>
>> shouldn't it be --name and then /usr/bin...
>
> Maybe that will work, but since I don't have a version 0.3.1 of
> start-stop-daemon to test it on I couldn't say what it would do.
>
> The oldest version of start-stop-daemon I currently have installed on
> any of my systems is 1.10.28 {and that's on my print server}
>
> 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.
>
> Adjust "-mtime +15" as needed.
> But 15 days seem a long time to keep known spoiling SPAM around.
>
>
> --
> DonJr
>
>
More information about the Novalug
mailing list