[Novalug] Re: weekly cron job
Jay Hart
jhart at kevla.org
Tue Jan 8 22:32:09 EST 2008
> /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.
shouldn't it be --name and then /usr/bin...
Also, which command is using the --chuid option/argument?
okno and spam are args for sa-learn
>
> but I used the '\' which are suppose to be followed by only a
> 'line-feed' character to continue the command onto the next line, in
> order to hopefully make it more readable.
>
>> Also, I wonder if this line:
>>
>> /sbin/start-stop-daemon --start --pidfile /dev/null \
>> --startas /bin/sh \
>> --oknodo --chuid $WHO \
>> -- -c "find ${SPAMDIR} -type f -mtime +15 | xargs rm -f"
Haven't tried this line yet...
>>
>> will also have the same problem on the fourth line?
>
> Same thing here, only the program is '/bin/sh' in this case.
>
>> Jay
>>
>> >> Jay Hart wrote:
>> >>> the script fails at this line:
>> >>>
>> >>> find ${SPAMDIR} -type f -print > /tmp/spamfiles
>> >>>
>> >>> with the following error:
>> >>>
>> >>> email:/etc/cron.weekly # ./spam-learn
>> >>> find: /home/jhart/MailDir/.knownspam: No such file or directory
>> >>>
>> >>> but this directory exists
>> >>>
>> >>> email:/home/jhart/Maildir # ls -l
>> >>> total 372
>> >>> <snip other directories>
>> >>> drwx------ 6 jhart users 4096 Aug 24 10:24 .knownspam
>> >>> <snip other directories>
>> >>>
>> >>> So, now I know why my script will not run to completion.
>> >>>
>> >>> What can I do to resolve???
>> >>>
>> >>> Jay
>> >>>
>> >> OK, this could be a typo in you mail, but:
>> >> MailDir and Maildir are not the same directory.
>> >>
>> >> Matt
>> >>
>> >
>> > *D*DJDJDDC(D*E&H$OD(D*E&&E(#)#ED&CH... You're right.
>> >
>> > Ok, that took care of that problem.
>> >
>> > Next problem:
>> >
>> > email:/etc/cron.weekly # ./spam-learn
>> > /sbin/start-stop-daemon: --signal takes a numeric argument
>> > Try `/sbin/start-stop-daemon --help' for more information.
>> >
>> > Jay
>
> I don't see how either invokation of "/sbin/start-stop-daemon" generated
> this message, unless you have trailing SPACES or other junk after a
> continue('\') character at the end of a line of text.
>
>
> --
> --
> Don E. Groves, Jr.
>
> $ /usr/games/fortune :
> In India, "cold weather" is merely a conventional phrase and has come
> into use through the necessity of having some way to distinguish between
> weather which will melt a brass door-knob and weather which will only
> make it mushy.
> -- Mark Twain
>
>
More information about the Novalug
mailing list