1 |
are you specifying the full path to logger? The environment when a |
2 |
script is run from cron is not always the same as the root env., so you |
3 |
typically have to specify the full path to the program... |
4 |
|
5 |
HTH, |
6 |
Rich |
7 |
|
8 |
|
9 |
|
10 |
Ben Munat wrote: |
11 |
|
12 |
> What's interesting is that cron ran my backup last night |
13 |
> successfully... but didn't send the output to the log. |
14 |
> |
15 |
> I have lines like "logger "Server backup: blah blah blah"" in my |
16 |
> script and I pipe the rdiff-backup output into logger as well. When I |
17 |
> ran the script from the command line, the output showed up just fine |
18 |
> in the log. But, when cron runs it, not a peep... and no dead.letter |
19 |
> either. |
20 |
> |
21 |
> Oh well, at least my nightly backup is automated now. |
22 |
> |
23 |
> b |
24 |
> |
25 |
> |
26 |
> Jacob Joseph wrote: |
27 |
> |
28 |
>> I was watching this conversation to see how others do this sort of |
29 |
>> thing and am glad to have learned of dead.letter. Thanks. |
30 |
>> |
31 |
>> Incidentally, I typically do this sort of debugging by just |
32 |
>> redirecting output to a file. That is: |
33 |
>> |
34 |
>> * * * * * root <script> > /tmp/foo 2>&1 |
35 |
>> |
36 |
>> It always seems like the easiest way to go. |
37 |
>> |
38 |
>> -Jacob |
39 |
>> |
40 |
>> Aaron Walker wrote: |
41 |
>> |
42 |
>>> -----BEGIN PGP SIGNED MESSAGE----- |
43 |
>>> Hash: SHA1 |
44 |
>>> |
45 |
>>> Ben Munat wrote: |
46 |
>>> |
47 |
>>> | PS: or maybe there's somewhere that cron puts the output when it |
48 |
>>> can't |
49 |
>>> | mail it? |
50 |
>>> |
51 |
>>> If you're running the script as root, mail it couldn't deliver would |
52 |
>>> be put in |
53 |
>>> /root/dead.letter. |
54 |
>>> |
55 |
>>> | |
56 |
>>> | Jonathan Rogers wrote: |
57 |
>>> | |
58 |
>>> |> |
59 |
>>> |> Yes, the programs in /etc/cron.* are running as root, but |
60 |
>>> probably not |
61 |
>>> |> with exactly the same environment as when you run them from a login |
62 |
>>> |> shell. The cron daemon should mail the output from your script if it |
63 |
>>> |> fails. If you can get the error messages, I might be able to help. |
64 |
>>> |> |
65 |
>>> |> Jonathan Rogers |
66 |
>>> |> |
67 |
>>> |
68 |
>>> |
69 |
>>> - -- |
70 |
>>> Eat drink and be merry, for tomorrow we diet. |
71 |
>>> |
72 |
>>> Aaron Walker < ka0ttic@g.o > http://dev.gentoo.org/~ka0ttic/ |
73 |
>>> Gentoo/BSD | cron | shell-tools |
74 |
>>> http://butsugenjitemple.org/~ka0ttic/ |
75 |
>>> |
76 |
>>> -----BEGIN PGP SIGNATURE----- |
77 |
>>> Version: GnuPG v1.2.6 (GNU/Linux) |
78 |
>>> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org |
79 |
>>> |
80 |
>>> iD8DBQFBlloKC3poscuANHARAja4AJ9qDNISjFWZlpDFd4jIzobQ8uh3rQCguO1t |
81 |
>>> y5+lQ06YyqeK58HvD2zRCpY= |
82 |
>>> =YsZz |
83 |
>>> -----END PGP SIGNATURE----- |
84 |
>> |
85 |
>> |
86 |
>> |
87 |
|
88 |
-- |
89 |
------------------------------------------------------------------------ |
90 |
Richard M Yumul |
91 |
rmy@×××××××××.com <mailto:rmy@×××××××××.com> |
92 |
SDTechnix |
93 |
http://www.sdtechnix.com |
94 |
------------------------------------------------------------------------ |