vanilla slackware crons script fix...
Hi, I just had some issue with the 'vanilla' cron scripts it might be interresting to change...
The script /etc/cron.daily/logrotate is ALWAYS returning an error (and one of my debian fellows "forced" to use slackware was complaining of bugs... :) )... Here is a proposition to fix it: Code:
#!/bin/sh Anyway, it's a tiny fix, and could reduce problem seeking for other people doing more complex stuff as cron jobs, stuff that requires to be informed if it fails or not (backup everybody ? :) ). Cheers Garry. |
I don't see any errors returned. Perhaps it would help if we knew what this error is?
|
The problem is the original scripts returns an error when there's no error...
Here is the original code: Code:
/usr/sbin/logrotate /etc/logrotate.conf |
I don't see the problem with the original code.
Code:
/usr/sbin/logrotate /etc/logrotate.conf add a log entry. In other words if the exit code is zero then the && part is never executed. |
Quote:
Code:
$ [ 0 != 0 ] && true ; echo "$?" Edit2: I mean the script RETURNS (not displays...), I mean the caller has an error code... So cron emit errors... |
I'd have used { ;} for grouping rather than a () subshell as it's slightly more efficient but otherwise I agree. Good catch, Garry.
Code:
/usr/sbin/logrotate /etc/logrotate.conf \ |
Quote:
How about this? Code:
/usr/sbin/logrotate /etc/logrotate.conf \ |
Hey volkerdi, does that do dependency resolution? :)
|
Quote:
|
This is the Debian version of logrotate:
Code:
#!/bin/sh |
All times are GMT -5. The time now is 04:32 AM. |