Re: Dar and anacron

Trevisi Roberto <[email protected]> Wed, 2 Apr 2025 22:04:50 +0200
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <CAGBoE9RWm_F7tJ1byPO5Xv2ykF7T9mJwfHN03kmD1VhZoSKf_A@mail.gmail.com>
--===============9014925680043562669==
Content-Type: multipart/alternative; boundary="0000000000004bcdef0631d12b99"

--0000000000004bcdef0631d12b99
Content-Type: text/plain; charset="UTF-8"

Hi,

I am new in bash scripting but if I redirect
STDOUT and STDERR to /dev/null I lose the log. Is it so ?

In any way the log now does not show that message


Regards
Roberto

On Wed, Apr 2, 2025, 19:02 Neil Darlow via Dar-support <
[email protected]> wrote:

> Hi,
>
> Have you tried appending:
>
> >/dev/null 2>&1
>
> to your dar invocations to prevent any dar output from triggering anacron
> to send the email?
>
> Regards,
> Neil Darlow
>
>
> On 2 April 2025 14:08:45 BST, Trevisi Roberto <[email protected]> wrote:
>
>> the dar_static version is 2.7.13
>>
>> Il giorno mer 2 apr 2025 alle ore 15:07 Trevisi Roberto <
>> [email protected]> ha scritto:
>>
>>> Ciao Denis,
>>>
>>> you were right, there is a second dar command in the script to test the
>>> created file (-t)
>>> I put the "-Q" option to the second instance too, but the anacron email
>>> with that message
>>> is sent anyway.
>>>
>>> I redirect all to a log file and, the strange thing is that before I put
>>> the first "-Q" option
>>> correctly I found two messages in log file, when I put the first "-Q"
>>> option correctly I
>>> found one message in log file, now that I put the second "-Q" option
>>> correctly the
>>> message there is no more in the log file, but anacron sends the email
>>> with that message anyway
>>>
>>>
>>> Roberto
>>>
>>>
>>> Il giorno mar 1 apr 2025 alle ore 19:34 Denis Corbin <[email protected]>
>>> ha scritto:
>>>
>>>> On 01/04/2025 18:52, Trevisi Roberto wrote:
>>>> > Hi Denis,
>>>>
>>>> Buongiorno Roberto,
>>>>
>>>> >
>>>> > anacron keeps sending the email with the message
>>>> >
>>>> > the dar command in the script is:
>>>> >
>>>> > /usr/bin/env dar_static -vm -vf -Q -z -D -R / -c "$file" \
>>>> >     par2 compress-exclusion --cache-directory-tagging -P boot/efi -P
>>>> dev
>>>> > -P proc -P run \
>>>> >     -P sys -P tmp -P var/tmp -P var/cache -P root/.cache \
>>>> >     -P home/user/.cache -P home/user/snap/firefox/common/.cache \
>>>> >     -P media -P cdrom -P mnt -P lost+found &>> "$logfile" &&
>>>> >
>>>> > I tried to put the "-Q" option immediately after "dar_static" and, as
>>>> above,
>>>> > after the verbose options, but in both cases anacron sends the email
>>>>
>>>> if -Q is passed to dar, dar just skips the display of the message,
>>>> whatever is the context. Anacron has no power to change that.
>>>>
>>>> I have double check that the information from command-line down to the
>>>> code triggering this message is properly propagated (version 2.7.17,
>>>> but
>>>> this par has not changed since 2.7.0 at least this the behavior is
>>>> likely the same with any 2.7.x version).
>>>>
>>>> Can you check you don't have several lines calling dar in you crontab
>>>> and/or anacron, for all users, and whether they all have -Q option set?
>>>>
>>>> By the way, which dar_static version are you using?
>>>> 'dar_static -V' will tell you...
>>>>
>>>> >
>>>> >
>>>> >
>>>>
>>>> Ciao,
>>>> Denis
>>>>
>>> --
> Sent from my Android device with K-9 Mail.
>

--0000000000004bcdef0631d12b99
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>Hi,=C2=A0</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">I am new in bash scripting but if I redirect=C2=A0</div><div dir=
=3D"auto">STDOUT and STDERR to /dev/null I lose the log. Is it so ?=C2=A0</=
div><div dir=3D"auto"><br></div><div dir=3D"auto">In any way the log now do=
es not show that message</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
><br></div><div dir=3D"auto">Regards</div><div dir=3D"auto">Roberto<br><br>=
<div class=3D"gmail_quote" dir=3D"auto"><div dir=3D"ltr" class=3D"gmail_att=
r">On Wed, Apr 2, 2025, 19:02 Neil Darlow via Dar-support &lt;<a href=3D"ma=
ilto:[email protected]" target=3D"_blank" rel=3D"noreferrer=
">[email protected]</a>&gt; wrote:<br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div><div dir=3D"auto">Hi,<br><br>Have you tried appending:=
<br><br>&gt;/dev/null 2&gt;&amp;1<br><br>to your dar invocations to prevent=
 any dar output from triggering anacron to send the email?<br><br>Regards,<=
br>Neil Darlow<br></div><br><br><div class=3D"gmail_quote"><div dir=3D"auto=
">On 2 April 2025 14:08:45 BST, Trevisi Roberto &lt;<a href=3D"mailto:jcclw=
[email protected]" rel=3D"noreferrer noreferrer" target=3D"_blank">jcclww2@gmail=
.com</a>&gt; wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:=
0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir=3D"ltr">the dar_static=C2=A0version is=C2=A02.7.13</div><br><div c=
lass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Il giorno mer 2 =
apr 2025 alle ore 15:07 Trevisi Roberto &lt;<a href=3D"mailto:jcclww2@gmail=
.com" rel=3D"noreferrer noreferrer" target=3D"_blank">[email protected]</a>=
&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
><div dir=3D"ltr">Ciao Denis,<div><br></div><div>you were right, there is a=
 second dar command in the script to test the created file (-t)</div><div>I=
 put the &quot;-Q&quot; option to the second instance too, but the anacron =
email with that message</div><div>is sent anyway.</div><div><br></div><div>=
I redirect all to a log file and, the strange thing is that before I put th=
e first &quot;-Q&quot; option=C2=A0</div><div>correctly I found two message=
s in log file, when I put the first &quot;-Q&quot; option correctly I</div>=
<div>found one message in log file, now that I put the second &quot;-Q&quot=
; option correctly the=C2=A0</div><div>message there is no more in the log =
file, but anacron sends the email=C2=A0</div><div>with that message anyway<=
/div><div><br></div><div><br></div><div>Roberto</div><div>=C2=A0</div></div=
><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Il gi=
orno mar 1 apr 2025 alle ore 19:34 Denis Corbin &lt;<a href=3D"mailto:dar.l=
[email protected]" rel=3D"noreferrer noreferrer" target=3D"_blank">dar.linux@fre=
e.fr</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">On 01/04/2025 18:52, Trevisi Roberto wrote:<br>
&gt; Hi Denis,<br>
<br>
Buongiorno Roberto,<br>
<br>
&gt; <br>
&gt; anacron keeps sending the email with=C2=A0the message<br>
&gt; <br>
&gt; the dar command in the script is:<br>
&gt; <br>
&gt; /usr/bin/env dar_static -vm -vf -Q -z -D -R / -c &quot;$file&quot; \<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0par2 compress-exclusion --cache-directory-tagging -=
P boot/efi -P dev <br>
&gt; -P proc -P run \<br>
&gt;=C2=A0 =C2=A0 =C2=A0-P sys -P tmp -P var/tmp -P var/cache -P root/.cach=
e \<br>
&gt;=C2=A0 =C2=A0 =C2=A0-P home/user/.cache -P home/user/snap/firefox/commo=
n/.cache \<br>
&gt;=C2=A0 =C2=A0 =C2=A0-P media -P cdrom -P mnt -P lost+found &amp;&gt;&gt=
; &quot;$logfile&quot; &amp;&amp;<br>
&gt; <br>
&gt; I tried to put the &quot;-Q&quot; option immediately after &quot;dar_s=
tatic&quot; and, as above,<br>
&gt; after the verbose options, but in both cases anacron sends the email<b=
r>
<br>
if -Q is passed to dar, dar just skips the display of the message, <br>
whatever is the context. Anacron has no power to change that.<br>
<br>
I have double check that the information from command-line down to the <br>
code triggering this message is properly propagated (version 2.7.17, but <b=
r>
this par has not changed since 2.7.0 at least this the behavior is <br>
likely the same with any 2.7.x version).<br>
<br>
Can you check you don&#39;t have several lines calling dar in you crontab <=
br>
and/or anacron, for all users, and whether they all have -Q option set?<br>
<br>
By the way, which dar_static version are you using?<br>
&#39;dar_static -V&#39; will tell you...<br>
<br>
&gt; <br>
&gt; <br>
&gt;<br>
<br>
Ciao,<br>
Denis<br>
</blockquote></div>
</blockquote></div>
</blockquote></div><div dir=3D"auto"><div>-- <br>Sent from my Android devic=
e with K-9 Mail.</div></div></div></blockquote></div></div></div>

--0000000000004bcdef0631d12b99--


--===============9014925680043562669==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============9014925680043562669==--