Re: Making a full backup with DAR

Сергей Цаболов <[email protected]>
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
Hello Denis,

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

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
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...

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

Is working if I go to cd /srv/back-rsync/viavi/archive

But I not found how witout add path of backup

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)

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

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?


07.07.2021 21:38, Denis Corbin пишет:
> On 07/07/2021 14:53, Сергей Цаболов wrote:
>> Hello to all.
> Hello Сергей,
>
>> I need to some help with setup full backup with dar some server.
>>
>> I read the page
>> http://dar.linux.free.fr/doc/mini-howto/dar-differential-backup-mini-howto.en.html#id5
>>
>>
>> And see  full command line I'll be using for my /system/ backup
>>
>> I make me command to test of backup.
>>
>> dar  -m 256 -y 6 -s 1000M -D /srv/archive -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
>>
>> The path /srv/archive is mount over NFS from TrueNas
>>
>> But after run the command to backup I give the
>>
>> Parse error: Given user target(s) could not be found:
>> /srv/back-rsync/viavi/archive
> I suggest you prepend "echo" to the dar command to see what is the
> result of the shell expansion:
>
> echo dar -m 256...
>
> you should see the "/srv/back-rsync/viavi/archive" string not introduced
> by any option (thus assumed to be a user target, where from the error
> message).
>
> This may also come from your ~/.darrc or /etc/darrc thus as second step
> I would add -v as first option to dar (without "echo" this time) if the
> previous test could not explain the problem.
>
> Don't hesitate to produce the output of these commands if don't find the
> typo.
>
>> Advise me how write command more correctly
>>
>>
>> Thanks
>>
> Cheers,
> Denis
>
>
>
>
-- 
-------------------------
С уважением
Сергей Цаболов,
Системный администратор
ООО "Т8"
Тел.: +74992716161,
Моб: +79850334875
[email protected]
ООО «Т8», 107076, г. Москва, Краснобогатырская ул., д. 44, стр.1
www.t8.ru
darrc.txt (text/plain, 3.6 KB)
#############################################################
# This is the default system wide configuration file for dar
#
# This file provide a set of options referred each by a target
# name. They are not applied unless you specify that target on
# command line or included file. For example for par2:
# dar <...list of options...> par2
#
# This options set are available automatically for dar unless
# you define a .darrc in your home directory or use -N option
# on command-line.
# You can continue using this default file even if you use your
# own .darrc file, by including the following in it or explicitely
# command-line:
#
#     -B /etc/darrc
#
# In the following we are using short options here because long
# options may not be available everywhere.

##############################################################
# target: par2
# activates:
#   - par2 file generation when creating an archive
#   - par2 file verification and correction when testing an archive
# usage: dar <options...>  par2

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

##############################################################
# target: compress-exclusion
# avoid compressing types of file known to already be compressed
# or to have very bad compression ratio
#
# usage: dar <options...> compress-exclusion

compress-exclusion:
# here we define some files that have not to be compressed.
# First setting case insentive mode on:
-an
# Then telling dar that the following masks are glob expression
# which is the default, right, but if sooner on command-line the
# user swapped to regex, the following mask would not work as expected
# any more, so we force back to glob expression in any case:
-ag

# Now follows all the file specification to never try to compress:

# compressed video format
-Z "*.mpg"
-Z "*.avi"
-Z "*.flac"
-Z "*.cr2"
-Z "*.vob"

# compressed picture format
-Z "*.jpg"
-Z "*.jpeg"
-Z "*.mpeg"
-Z "*.png"

# compressed audio format
-Z "*.mp3"
-Z "*.ogg"

# compressed package
-Z "*.deb"
-Z "*.tgz"
-Z "*.tbz2"
-Z "*.rpm"
-Z "*.xpi"
-Z "*.run"
-Z "*.sis"

# other compressed data
-Z "*.gz"
-Z "*.Z"
-Z "*.bz2"
-Z "*.zip"
-Z "*.jar"
-Z "*.rar"
-Z "*.xz"

# dar archives (may be compressed)
-Z "*.dar"

# Now we swap back to case sensitive mode for masks which is the default
# mode:
-acase

##############################################################
#  target: verbose
#  show both skipped files and files being processed
#
# usage: dar <options> verbose
verbose:
-va


##############################################################
# target: no-emacs-backup
# ignore temporary files or backup files generated by emacs
#
no-emacs-backup:
-ag
-X "*~"
-X ".*~"

##############################################################
# target: samba
# take care of daylight saving time for the samba filesystem
# type

samba:
-H 1
# samba filesystem need this to properly report date
# and not lead dar to resave all files when changing
# from summer to winter time and viceversa.

##############################################################
# target: dry-run
# an alias for --empty option, that get its name because the
# only available option letter was 'e' that leads to this non
# intuitive option name "empty".
#
dry-run:
-e

##############################################################
# target: bell
# ring the terminal upon user interaction request
#
bell:
-b

##############################################################
# target: full-from-diff
# rebuilds a full backup from a differential backup and its
# full backup of reference
# usage: dar -+ new_full -A old_ref_full -@ diff full-from-diff
#

full-from-diff:
-/ '{!(~I)}[Rr] {~S}[O*] P* ; {~s}[*o] *p'
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.