Full path name in dar create and traversing in directories (monitoring , log , dbp script)
[email protected] Fri, 3 Jan 2025 14:15:23 +0100
| Newsgroups | gmane.comp.sysutils.backup.dar.support |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============2721562320300425047==
Content-Type: multipart/alternative;
boundary="------------Irnbb52B0Nit0230PHZw3D9o"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------Irnbb52B0Nit0230PHZw3D9o
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi All,
The Best Wishes for 2025 :-)
I'm trying to monitor what DAR is doing.
I found at first sight a perfect option to get some information namely
the option :
'-<' and '-=' in combination with 'dar %p'
If I look into the documentation it says :
/|%p| is replaced by the full path (including filename) of the
file/directory to be saved /
So I got the impression that every file or directory that is processed
will be send to the .dbp script.
That seems not be the case.
I'm using the following command :
root:~# dar -c `date -I`_dartest-backup -R /home -D -X *.dar '-<*' -=
"/root/bin/dar_log_current.dbp %p %c darstat_log"
With /home I get only
/home/user1
/home/user2
/home/user3
in my darstat_log
However when I use /home/user1 I get every single file and path/filename
under that directory in my darstat_log
Strange ???
Is it somehow possible to force sending every path/file to the .dbp script ?
As you can see I also use -X *.dar in my commandline.
It seems dar doesn't prevents itself of "eating" its own archive.
Is there a rationale for ?
Reading through some other entries in the mailinglist and "File
filtering" in the documentation I still
have a hard time bending my head around this all.
Thanks you very much and with kind regards,
Jonathan.
dar_log_current.dbp contains :
# for better readability:
path_file="$1"
context="$2"
log_file="$3"
echo "filename = ${path_file}"
# use 'stat -c' with some options like stat -c '%b %B %o %h %i %s %m %n %F'
# number of blocks , size of block , optimal size of transfer hint ,
number of hard links , inode number , total size , mount point , file type
if [ -n "$path_file" ]; then
if [ "$context" = "start" ] ; then
echo $(date +'%Y-%m-%d_%T.%N') " $(stat -c '%b %B %o %h %i %s %m %n
%F' ${path_file})" >>${log_file}
fi
fi
--------------Irnbb52B0Nit0230PHZw3D9o
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hi All,<br>
<br>
The Best Wishes for 2025 :-)<br>
<br>
I'm trying to monitor what DAR is doing.<br>
I found at first sight a perfect option to get some information
namely the option :<br>
<br>
<font face="Courier New, Courier, monospace">'-<' </font>and '<font
face="Courier New, Courier, monospace">-=</font>' in combination
with '<font face="Courier New, Courier, monospace">dar %p</font>'<br>
<br>
If I look into the documentation it says :<br>
<br>
<i><code>%p</code> is replaced by the full path (including filename)
of the file/directory to be saved </i><br>
<br>
So I got the impression that every file or directory that is
processed will be send to the .dbp script.<br>
That seems not be the case.<br>
I'm using the following command :<br>
<br>
<font face="Courier New, Courier, monospace">root:~# dar -c `date
-I`_dartest-backup -R /home -D -X *.dar '-<*' -=
"/root/bin/dar_log_current.dbp %p %c darstat_log"</font><br>
<br>
With <font face="Courier New, Courier, monospace">/home</font> I
get only <br>
<font face="Courier New, Courier, monospace">/home/user1<br>
/home/user2<br>
/home/user3 </font><br>
in my darstat_log<br>
<br>
However when I use <font face="Courier New, Courier, monospace">/home/user1</font>
I get every single file and path/filename under that directory in my
<font face="Courier New, Courier, monospace">darstat_log</font><br>
Strange ???<br>
<br>
Is it somehow possible to force sending every path/file to the .dbp
script ?<br>
<br>
As you can see I also use <font
face="Courier New, Courier, monospace">-X *.dar</font> in my
commandline.<br>
It seems dar doesn't prevents itself of "eating" its own archive.<br>
Is there a rationale for ?<br>
<br>
Reading through some other entries in the mailinglist and "File
filtering" in the documentation I still <br>
have a hard time bending my head around this all.<br>
<br>
Thanks you very much and with kind regards,<br>
<br>
Jonathan.<br>
<br>
<font face="Courier New, Courier, monospace">dar_log_current.dbp</font>
contains :<br>
<br>
<font face="Courier New, Courier, monospace"># for better
readability:<br>
path_file="$1"<br>
context="$2"<br>
log_file="$3"<br>
<br>
echo "filename = ${path_file}"<br>
<br>
# use 'stat -c' with some options like stat -c '%b %B %o %h %i %s
%m %n %F'<br>
# number of blocks , size of block , optimal size of transfer hint
, number of hard links , inode number , total size , mount point ,
file type<br>
<br>
if [ -n "$path_file" ]; then<br>
if [ "$context" = "start" ] ; then<br>
echo $(date +'%Y-%m-%d_%T.%N') " $(stat -c '%b %B %o %h %i %s
%m %n %F' ${path_file})" >>${log_file} <br>
fi<br>
fi</font>
</body>
</html>
--------------Irnbb52B0Nit0230PHZw3D9o--
--===============2721562320300425047==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============2721562320300425047==--