Post #318,461
12/11/09 7:24:49 PM
|
How?
I just looked at the man page and didn't see an option to dump output to stdout. Or do you let it keep dropping numbered files, rather than have it write to a logfile?
--
Drew
|
Post #318,462
12/11/09 7:57:33 PM
|
cmd >>out.txt file appends output to out.txt
or cmd >outputfile 2>&1
to catch any errors as well
thanx,
bill
|
Post #318,465
12/11/09 9:52:33 PM
|
Re: How?
-O file
--output-document=file
The documents will not be written to the appropriate files,
but all will be concatenated together and written to file.
If - is used as file, documents will be printed to standard
output, disabling link conversion. (Use ./- to print to a
file literally named -.)
Regards, -scott Welcome to Rivendell, Mr. Anderson.
|
Post #318,466
12/11/09 10:20:35 PM
|
Ahh, output-document ... so intuitive
I'll give it a try, but it may not help. I've tried it now with links and lynx, and it does the same thing. Just added logging the pid and creating a lockfile. It's the same process, but for some reason when run via cron it executes the script twice. When I call it manually it just executes once.
Is there a system-level log of what cron executes? What I mean is, aside from the logging that I do myself within the script, is there a log that shows "cron executed script foo at time"?
--
Drew
|
Post #318,468
12/11/09 11:22:21 PM
|
typically /var/log/messages and any output is sent to root..
or the user the cron is executed as.
|
Post #318,481
12/12/09 12:31:03 PM
|
Nothing in /var/log/messages
But /var/log/auth.log shows cron starting and stopping. For some reason cron runs twice each minute for root.
auth.log:Dec 12 09:14:01 ps17185 CRON[22094]: (pam_unix) session opened for user root by (uid=0)
auth.log:Dec 12 09:14:01 ps17185 CRON[22094]: (pam_unix) session closed for user root
auth.log:Dec 12 09:15:01 ps17185 CRON[22788]: (pam_unix) session opened for user root by (uid=0)
auth.log:Dec 12 09:15:01 ps17185 CRON[22787]: (pam_unix) session opened for user root by (uid=0)
auth.log:Dec 12 09:15:01 ps17185 CRON[22787]: (pam_unix) session closed for user root
auth.log:Dec 12 09:15:01 ps17185 CRON[22792]: (pam_unix) session opened for user drook by (uid=0)
auth.log:Dec 12 09:15:01 ps17185 CRON[22788]: (pam_unix) session closed for user root
auth.log:Dec 12 09:15:04 ps17185 CRON[22792]: (pam_unix) session closed for user drook
auth.log:Dec 12 09:16:01 ps17185 CRON[23731]: (pam_unix) session opened for user root by (uid=0)
auth.log:Dec 12 09:16:01 ps17185 CRON[23731]: (pam_unix) session closed for user root
That shows a single instance of it for my user at 15 after the hour, which is correct. But I still don't trust it. Need to create a copy of the script with heavy debugging in it but not actually send the email and cron that.
--
Drew
|
Post #318,486
12/12/09 4:10:09 PM
|
Re: Nothing in /var/log/messages
is a mail server on the machine?
If not check the root user /var/mail/<user>
Any output not redirected by the script is sent to the local user, unless aliases redirect it.
|
Post #318,492
12/12/09 9:48:06 PM
|
Nope, not there either
Adding debugging calls now. How tedious ...
--
Drew
|
Post #318,506
12/13/09 11:06:45 AM
|
Check /etc/syslog.conf
You can adjust cron logging there. Adding
cron.debug /var/log/cron
will send cron's own debug output to /var/log/cron. Don't forget to recycle the syslog daemon after changing the configuration.
|
Post #318,510
12/13/09 12:34:07 PM
|
Good point.
Egads...
debug level wooo
Drew make sure you have your log rotation proper.
|
Post #318,513
12/13/09 1:32:30 PM
|
That would do it
Only entries in there for cron right now are
#cron.* /var/log/cron.log
and
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
So I'm not getting much info.
Assuming this can throw a huge amount of crap to disk in a hurry, what do I need to do to make sure I don't eat the disk before I can catch it?
--
Drew
|
Post #318,516
12/13/09 2:38:09 PM
|
set it for a single pass first, then debug
once you find the issue, then adjust the schedule.
|