Re: Par2 run twice

Trevisi Roberto <[email protected]> Sat, 22 Feb 2025 16:53:50 +0100
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <CAGBoE9SNsb1hMtrQ57hD2K0tSCi=RfmOVCiuV4RpSKOTJVbSDA@mail.gmail.com>
--===============4997129609621442378==
Content-Type: multipart/alternative; boundary="000000000000219c4a062ebd1f77"

--000000000000219c4a062ebd1f77
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Denis

Confirm =F0=9F=91=8D

Regards
Roberto

Il giorno sab 22 feb 2025 alle ore 14:22 Denis Corbin <[email protected]>
ha scritto:

> Hi Roberto,
>
> I was surprised to be able to reproduce the problem you observe, while I
> use par2 very often with dar.
>
> The problem comes from the fact you explicitely include /etc/darrc (-B
> /etc/darrc), while it is read by default (unless you give -N option).
>
> As such, the par2 target (as well as the compress-exclussion target) is
> executed twice :
> - once in the included by default /etc/darrc
> - once in the -B included /etc/darrc
>
> for compress-exclusion this should not bring much problem (eventually a
> very little performance penalty as the file filter is twice larger than
> necessary) but for par2 this leads to the problem you report: the second
> time par2 complains the file already exist.
>
> Solutions :
> - either add -N option for the /etc/darrc not to be included by default
> - or do not explicitely add -B /etc/darrc in you command
>
> Regards,
> Denis
>
>
> On 22/02/2025 13:49, Trevisi Roberto wrote:
> > Hi, I'm using par2 with DAR Disk Archiver
> > it is the first time I included it in DAR backup process
> >
> > The dar command is:
> > # backup command
> > /usr/bin/env dar_static -vm -vd -vf -z -D -R / -c "$FILE" -B /etc/darrc=
 \
> >     par2 compress-exclusion -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
> >
> > The error is:
> > Closing archive low layer...
> > creating PAR file for file /mnt/backup/backup/host/ubuntu24.04/
> > full_backup/live/2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar ..=
.
> >
> > Block size: 6346252
> > Source file count: 1
> > Source block count: 2000
> > Recovery block count: 40
> > Recovery file count: 1
> >
> > Opening: 2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar
> > Computing Reed Solomon matrix.
> > Constructing: done.
> > Wrote 134217600 bytes to disk
> > Wrote 119632480 bytes to disk
> > Writing recovery packets
> > Writing verification packets
> > Done
> > creating PAR file for file /mnt/backup/backup/host/ubuntu24.04/
> > full_backup/live/2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar ..=
.
> >
> > Block size: 6346252
> > Source file count: 1
> > Source block count: 2000
> > Recovery block count: 40
> > Recovery file count: 1
> >
> > Could not create "/mnt/backup/backup/host/ubuntu24.04/full_backup/
> > live/2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar.vol00+40.par2"=
:
> > File already exists.
> > Error during user command line execution: execution of [ /usr/share/doc=
/
> > dar/examples/dar_par_create.duc "/mnt/backup/backup/host/ubuntu24.04/
> > full_backup/live" "2025-02-22_live-backup_ubuntu-24.04_host_full" 1 dar
> > last_slice 2 ; /usr/share/doc/dar/examples/dar_par_create.duc "/mnt/
> > backup/backup/host/ubuntu24.04/full_backup/live" "2025-02-22_live-
> > backup_ubuntu-24.04_host_full" 1 dar last_slice 2 ] returned error code=
:
> > 1536 .
> > Retry command-line ? [return =3D YES | Esc =3D NO]
> >
> >
> > files in backup dir are:
> > $ ls -l
> > total 12684708
> > -rwxrwxrwx 1 root root    35354169 Feb 22 09:45 2025-02-22_boot-
> > efi_host.tar.gz
> > -rwxrwxrwx 1 root root     7139472 Mar 31  2024 2025-02-22_dar_static
> > -rwxrwxrwx 1 root root 12692503368 Feb 22 09:37 2025-02-22_live-
> > backup_ubuntu-24.04_host_full.1.dar
> > -rwxrwxrwx 1 root root       40452 Feb 22 09:40 2025-02-22_live-
> > backup_ubuntu-24.04_host_full.1.dar.par2
> > -rwxrwxrwx 1 root root   254094992 Feb 22 09:40 2025-02-22_live-
> > backup_ubuntu-24.04_host_full.1.dar.vol00+40.par2
> >
> >
> > par2 is called by /etc/darrc:
> > par2:
> >    -B "/usr/share/doc/dar/examples/dar_par.dcf"
> >
> > The file /usr/share/doc/dar/examples/dar_par.dcf:
> > # configuration file for dar to have Parchive integrated
> > # with DAR
> > # to be passed to dar as argument of -B option (-B dar_par.dcf)
> > # either directly on command line or through $HOME/.darrc or /etc/darrc
> > # file
> >
> > create:
> >          -E '/usr/share/doc/dar/examples/dar_par_create.duc "%p" "%b" %=
N
> > %e %c 2'
> > # 2 stands for 2% of redundancy
> > # adjust it to your needs
> >
> > test:
> >          -E '/usr/share/doc/dar/examples/dar_par_test.duc "%p" "%b" %N
> > %e %c'
> >
> > # note that you may need to set the path to dar_par_test.duc
> > # and dar_par_create.duc, at dar/libdar installation, /usr/share/doc/
> > dar/examples
> > # is substitued by the path where these are installed to
> >
> > # fix from Sergey Feo
> > default:
> > -E "echo Warning: dar_par.dcf will not be used in this operation. Pleas=
e
> > review command line options. -c or -t should be used before -
> > B ...dar_par.dcf"
> >
> >
> > The file /usr/share/doc/dar/examples/dar_par_test.duc:
> > #!/bin/sh
> > ###
> > #
> > # this script is to be launched on dar command line when creating an
> > archive with -s option (slicing)
> > # you need to run this script from dar, adding the following argument o=
n
> > command-line
> > #
> > #     -E "dar_par_create.duc %p %b %N %e %c 20"
> > #
> > # note that 20 means 20% of redundancy, tune it to your needs
> > #
> > ###
> > #
> > # if you prefer you can also add the line above in your the $HOME/.darr=
c
> > file
> > # under the create: conditional statement (see dar man page)
> > #
> > ###
> > #
> > # usage par_script slice.basename slice.number extension level
> > # generates a Parchive redundancy file from the slice file
> > #
> > ###
> >
> > if [ "$1" =3D "" -a "$2" =3D "" -a "$3" =3D "" -a "$4" =3D "" -a "$6" =
=3D "" ];
> then
> >    echo "usage: $0 <path> <basename> <slice number> <extension>
> > <context(not used)> <redundancy ratio (%)>"
> >    echo "$0 builds Parchive redundancy file for the given slice"
> >    exit 1
> > fi
> >
> > # change according to you need
> > PAR=3Dpar2
> >
> > echo "creating PAR file for file $1/$2.$3.dar ..."
> >
> > exec $PAR c -r$6 -n1 "$1/$2.$3.$4"
> > # script returned code it those of par
> >
> >
> >
> > Have you any solution ?
> >
> > Thanks in advance
> >
>
>

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

<div dir=3D"ltr">Hi Denis<div><br></div><div>Confirm=C2=A0=F0=9F=91=8D</div=
><div><br></div><div>Regards</div><div>Roberto</div></div><br><div class=3D=
"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">I=
l giorno sab 22 feb 2025 alle ore 14:22 Denis Corbin &lt;<a href=3D"mailto:=
[email protected]">[email protected]</a>&gt; ha scritto:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">Hi Roberto,<br>
<br>
I was surprised to be able to reproduce the problem you observe, while I <b=
r>
use par2 very often with dar.<br>
<br>
The problem comes from the fact you explicitely include /etc/darrc (-B <br>
/etc/darrc), while it is read by default (unless you give -N option).<br>
<br>
As such, the par2 target (as well as the compress-exclussion target) is <br=
>
executed twice :<br>
- once in the included by default /etc/darrc<br>
- once in the -B included /etc/darrc<br>
<br>
for compress-exclusion this should not bring much problem (eventually a <br=
>
very little performance penalty as the file filter is twice larger than <br=
>
necessary) but for par2 this leads to the problem you report: the second <b=
r>
time par2 complains the file already exist.<br>
<br>
Solutions :<br>
- either add -N option for the /etc/darrc not to be included by default<br>
- or do not explicitely add -B /etc/darrc in you command<br>
<br>
Regards,<br>
Denis<br>
<br>
<br>
On 22/02/2025 13:49, Trevisi Roberto wrote:<br>
&gt; Hi, I&#39;m using par2 with DAR Disk Archiver<br>
&gt; it is the first time I included it in DAR backup process<br>
&gt; <br>
&gt; The dar command is:<br>
&gt; # backup command<br>
&gt; /usr/bin/env dar_static -vm -vd -vf -z -D -R / -c &quot;$FILE&quot; -B=
 /etc/darrc \<br>
&gt;=C2=A0 =C2=A0 =C2=A0par2 compress-exclusion -P boot/efi -P dev -P proc =
-P run \<br>
&gt;=C2=A0 =C2=A0 =C2=A0-P sys -P tmp -P var/tmp -P var/cache -P root+/.cac=
he \<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<br>
&gt; <br>
&gt; The error is:<br>
&gt; Closing archive low layer...<br>
&gt; creating PAR file for file /mnt/backup/backup/host/ubuntu24.04/ <br>
&gt; full_backup/live/2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar .=
..<br>
&gt; <br>
&gt; Block size: 6346252<br>
&gt; Source file count: 1<br>
&gt; Source block count: 2000<br>
&gt; Recovery block count: 40<br>
&gt; Recovery file count: 1<br>
&gt; <br>
&gt; Opening: 2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar<br>
&gt; Computing Reed Solomon matrix.<br>
&gt; Constructing: done.<br>
&gt; Wrote 134217600 bytes to disk<br>
&gt; Wrote 119632480 bytes to disk<br>
&gt; Writing recovery packets<br>
&gt; Writing verification packets<br>
&gt; Done<br>
&gt; creating PAR file for file /mnt/backup/backup/host/ubuntu24.04/ <br>
&gt; full_backup/live/2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar .=
..<br>
&gt; <br>
&gt; Block size: 6346252<br>
&gt; Source file count: 1<br>
&gt; Source block count: 2000<br>
&gt; Recovery block count: 40<br>
&gt; Recovery file count: 1<br>
&gt; <br>
&gt; Could not create &quot;/mnt/backup/backup/host/ubuntu24.04/full_backup=
/ <br>
&gt; live/2025-02-22_live-backup_ubuntu-24.04_host_full.1.dar.vol00+40.par2=
&quot;: <br>
&gt; File already exists.<br>
&gt; Error during user command line execution: execution of [ /usr/share/do=
c/ <br>
&gt; dar/examples/dar_par_create.duc &quot;/mnt/backup/backup/host/ubuntu24=
.04/ <br>
&gt; full_backup/live&quot; &quot;2025-02-22_live-backup_ubuntu-24.04_host_=
full&quot; 1 dar <br>
&gt; last_slice 2 ; /usr/share/doc/dar/examples/dar_par_create.duc &quot;/m=
nt/ <br>
&gt; backup/backup/host/ubuntu24.04/full_backup/live&quot; &quot;2025-02-22=
_live- <br>
&gt; backup_ubuntu-24.04_host_full&quot; 1 dar last_slice 2 ] returned erro=
r code: <br>
&gt; 1536 .<br>
&gt; Retry command-line ? [return =3D YES | Esc =3D NO]<br>
&gt; <br>
&gt; <br>
&gt; files in backup dir are:<br>
&gt; $ ls -l<br>
&gt; total 12684708<br>
&gt; -rwxrwxrwx 1 root root =C2=A0 =C2=A035354169 Feb 22 09:45 2025-02-22_b=
oot- <br>
&gt; efi_host.tar.gz<br>
&gt; -rwxrwxrwx 1 root root =C2=A0 =C2=A0 7139472 Mar 31 =C2=A02024 2025-02=
-22_dar_static<br>
&gt; -rwxrwxrwx 1 root root 12692503368 Feb 22 09:37 2025-02-22_live- <br>
&gt; backup_ubuntu-24.04_host_full.1.dar<br>
&gt; -rwxrwxrwx 1 root root =C2=A0 =C2=A0 =C2=A0 40452 Feb 22 09:40 2025-02=
-22_live- <br>
&gt; backup_ubuntu-24.04_host_full.1.dar.par2<br>
&gt; -rwxrwxrwx 1 root root =C2=A0 254094992 Feb 22 09:40 2025-02-22_live- =
<br>
&gt; backup_ubuntu-24.04_host_full.1.dar.vol00+40.par2<br>
&gt; <br>
&gt; <br>
&gt; par2 is called by /etc/darrc:<br>
&gt; par2:<br>
&gt;=C2=A0 =C2=A0 -B &quot;/usr/share/doc/dar/examples/dar_par.dcf&quot;<br=
>
&gt; <br>
&gt; The file=C2=A0/usr/share/doc/dar/examples/dar_par.dcf:<br>
&gt; # configuration file for dar to have Parchive integrated<br>
&gt; # with DAR<br>
&gt; # to be passed to dar as argument of -B option (-B dar_par.dcf)<br>
&gt; # either directly on command line or through $HOME/.darrc or /etc/darr=
c<br>
&gt; # file<br>
&gt; <br>
&gt; create:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -E &#39;/usr/share/doc/dar/examples/=
dar_par_create.duc &quot;%p&quot; &quot;%b&quot; %N <br>
&gt; %e %c 2&#39;<br>
&gt; # 2 stands for 2% of redundancy<br>
&gt; # adjust it to your needs<br>
&gt; <br>
&gt; test:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -E &#39;/usr/share/doc/dar/examples/=
dar_par_test.duc &quot;%p&quot; &quot;%b&quot; %N <br>
&gt; %e %c&#39;<br>
&gt; <br>
&gt; # note that you may need to set the path to dar_par_test.duc<br>
&gt; # and dar_par_create.duc, at dar/libdar installation, /usr/share/doc/ =
<br>
&gt; dar/examples<br>
&gt; # is substitued by the path where these are installed to<br>
&gt; <br>
&gt; # fix from Sergey Feo<br>
&gt; default:<br>
&gt; -E &quot;echo Warning: dar_par.dcf will not be used in this operation.=
 Please <br>
&gt; review command line options. -c or -t should be used before - <br>
&gt; B ...dar_par.dcf&quot;<br>
&gt; <br>
&gt; <br>
&gt; The file=C2=A0/usr/share/doc/dar/examples/dar_par_test.duc:<br>
&gt; #!/bin/sh<br>
&gt; ###<br>
&gt; #<br>
&gt; # this script is to be launched on dar command line when creating an <=
br>
&gt; archive with -s option (slicing)<br>
&gt; # you need to run this script from dar, adding the following argument =
on <br>
&gt; command-line<br>
&gt; #<br>
&gt; # =C2=A0 =C2=A0 -E &quot;dar_par_create.duc %p %b %N %e %c 20&quot;<br=
>
&gt; #<br>
&gt; # note that 20 means 20% of redundancy, tune it to your needs<br>
&gt; #<br>
&gt; ###<br>
&gt; #<br>
&gt; # if you prefer you can also add the line above in your the $HOME/.dar=
rc <br>
&gt; file<br>
&gt; # under the create: conditional statement (see dar man page)<br>
&gt; #<br>
&gt; ###<br>
&gt; #<br>
&gt; # usage par_script slice.basename slice.number extension level<br>
&gt; # generates a Parchive redundancy file from the slice file<br>
&gt; #<br>
&gt; ###<br>
&gt; <br>
&gt; if [ &quot;$1&quot; =3D &quot;&quot; -a &quot;$2&quot; =3D &quot;&quot=
; -a &quot;$3&quot; =3D &quot;&quot; -a &quot;$4&quot; =3D &quot;&quot; -a =
&quot;$6&quot; =3D &quot;&quot; ]; then<br>
&gt;=C2=A0 =C2=A0 echo &quot;usage: $0 &lt;path&gt; &lt;basename&gt; &lt;sl=
ice number&gt; &lt;extension&gt; <br>
&gt; &lt;context(not used)&gt; &lt;redundancy ratio (%)&gt;&quot;<br>
&gt;=C2=A0 =C2=A0 echo &quot;$0 builds Parchive redundancy file for the giv=
en slice&quot;<br>
&gt;=C2=A0 =C2=A0 exit 1<br>
&gt; fi<br>
&gt; <br>
&gt; # change according to you need<br>
&gt; PAR=3Dpar2<br>
&gt; <br>
&gt; echo &quot;creating PAR file for file $1/$2.$3.dar ...&quot;<br>
&gt; <br>
&gt; exec $PAR c -r$6 -n1 &quot;$1/$2.$3.$4&quot;<br>
&gt; # script returned code it those of par<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Have you any solution ?<br>
&gt; <br>
&gt; Thanks in advance<br>
&gt; <br>
<br>
</blockquote></div>

--000000000000219c4a062ebd1f77--


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


--===============4997129609621442378==--