Re: Making a full backup with DAR

Denis Corbin <[email protected]>
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
On 08/07/2021 10:24, Сергей Цаболов wrote:
> Hello Denis,

Hello,

> 
> I found the file /etc/drrc on the attach
> 
> If I use the command :
> 
> dar -v -m 256  -s 1000M -D -R / -c `date -I`_data -Z "*.gz" -Z "*.bz2"
> -Z "*.zip" -Z "*.png" -P srv -P dev -P proc -P sys -P tmp -P run -P mnt
> -P media par2
> 
> give the output
> 
> Arguments read from /etc/darrc :
>  "/srv/back-rsync/viavi/archive"  I add the path to backups

OK, there is something wrong in the par2 target found in /etc/darrc,
according the file you attached in your email, "par2" target is replaced
by the following:

 -B "/usr/share/doc/dar/examples/dar_par.dcf"

If this file is the one provided with dar, it should trigger the
following options (creation context):

-E '/usr/share/doc/share/examples/dar_par_create.duc "%p" "%b" %N %e %c 2'

%p is substitued by the backup path: here the backup is `date -I` which
does not contain any '/' thus dar assumes the backup to be stored in the
current directory.
%b by the result of `date -I`
%N by the slice number
%e by 'dar' (the backup extension)
%c by the context

Only %p is unknown to me. Can you confirm that you run dar from the
"/srv/back-rsync/viavi/archive" directory?

> 
> User target found on command line or included file(s):
>     par2
>     /srv/back-rsync/viavi/archive
> Parse error: Given user target(s) could not be found:
> /srv/back-rsync/viavi/archive
> 
> After if remove the -v error is
> 
> Parse error: Given user target(s) could not be found:
> /srv/back-rsync/viavi/archive
> 
> After this i user the command
> 
> dar -v -m 256  -s 1000M -D -R / -c `date -I`_data  -Z "*.gz" -Z "*.bz2"
> -Z "*.zip" -Z "*.png" -P srv -P dev -P proc -P sys -P tmp -P run -P mnt
> -P media
> 
> output is :
> 
> Arguments read from /etc/darrc :
> 
> -Y and -Z are only useful with compression (-z option), ignoring any -Y
> and -Z option
> -m is only useful with compression (-z option), ignoring -m

This message in independent from the initial problem: yes, you need to
add compression if you want to use -m, -Z and -Y option.

> Creating low layer: Writing archive into a sar object (Segmentation and
> Reassembly) for slicing...
> Writing down the archive header...
> Adding a new layer on top: Caching layer for better performances...
> Adding a new layer on top: Escape layer to allow sequential reading...
> All layers have been created successfully
> Building the catalog object...
> Processing files for backup...

OK thus the backup is working when you removed par2, this confirms the
problem to be releated to

> 
> I see is working now but the problem is backup files maked in the
> directory stay now /etc/

Not sure to understand, you gave -R / thus dar should not save only
what's in /etc except if there is nothing else outside /srv /dev /proc
/sys /tmp /run /mnt and /media (as you have excluded all these by mean
of -P option)

> 
> Is working if I go to cd /srv/back-rsync/viavi/archive
> 
> But I not found how witout add path of backup

you can specify the backup path like this:

dar -c /srv/backup-rsync/viavi/archive/`date -I` ...

> 
> In
> http://dar.linux.free.fr/doc/mini-howto/dar-differential-backup-mini-howto.en.html#id5 
> not have  path of the backup (the full command line)

can you rather refer to the tutorial: the mini-howto has not been
updated by its author for long time and may suffer from obsolete syntaxes!

> 
> In the scripts demo the DIR is added
> 
> -------------------------------------------------------------------------------
> 
> #!/bin/bash
> 
> *DIR=/var/backups/system*
> FILE=${DIR}/`/bin/date -I`_diff
> PREV=`/bin/ls $DIR/*.dar|/usr/bin/tail -n 1`
> /usr/local/bin/dar -m 256 -y -s 600M -D -R / -c $FILE -Z "*.gz" \
>    -Z "*.bz2" -Z "*.zip" -Z "*.png" -P home/gradha -P tmp -P mnt \
>    -P dev/pts -P proc -P floppy -P burner -P cdrom \
>    -P var/backups -A ${PREV%%.*} > /dev/null
> /usr/local/bin/dar -t $FILE > /dev/null
> /usr/bin/find $DIR -type f -exec chown .gradha \{\} \;
> /usr/bin/find $DIR -type f -exec chmod 440 \{\} \;
> -----------------------------------------------------------------
> 
> /usr/local/bin/dar is not right path
> In my case is  /usr/bin/dar 

this depends on the way dar has been installed, most distro install in
/usr tree but if you install dar yourself, and use the default
installation path, dar will end in the /usr/local directory tree.

> 
> In command :
> 
> /usr/bin/dar -m 256 -y -s 600M -D -R / -c $FILE -Z "*.gz" -Z "*.bz2" -Z "*.zip" -Z "*.png" -P proc -P tmp -P mnt -P dev -P sys -P srv -P mnt -P media -P  -A ${PREV%%.*} > /dev/null 
> 
> We can add the path to backup?

first there is -Q and -q options if you want less output (better than
redirecting to /dev/null so you can still see the error messages)

second to answer your question, you can add path to backup as explained
above:

/usr/bin/dar/ -m 256 -t -s 600M -D -R / -c $PATH_TO_BACKUP/$FILE ...


> 
>[...]

Cheers,
Denis
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.