list deleted files from rdiff-backup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

list deleted files from rdiff-backup

Andreas Weber
Dear all,

is it possible to list deleted files and which increment first recorded
the deletion? I tried to write a simple script but this gets very slow
with many increments:

#!/bin/bash -e

inc_dates=($(rdiff-backup --list-increments "$1" | tail -n+2 | head -n-1
| cut -d "." -f2))
total=${#inc_dates[*]}

for (( i=0; i<$(( $total )); i++ ))
do
  tmplist[$i]=$(tempfile);
  rdiff-backup --list-at-time "${inc_dates[$i]}" "$1" | sort >
"${tmplist[$i]}"
  if [ "$i" -gt 0 ]; then
    deleted=($(comm -2 -3 "${tmplist[$i-1]}" "${tmplist[$i]}"))

    nr=${#deleted[*]}

    if [ "$nr" -gt 0 ]; then
      echo "$nr file(s) deleted between ${inc_dates[$i-1]} and
${inc_dates[$i]}:"
      printf '%s\n' "${deleted[@]}"
    fi

  fi
done

Thank you, Andy

PS: I also asked on serverfault 2 days ago:
https://serverfault.com/questions/983941/list-deleted-files-from-rdiff-backup

_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Re: list deleted files from rdiff-backup

Patrik Dufresne-2
If I do understand your request, you want to list the files that was
deleted from the source directory over all the increment known by
rdiff-backup repository ?

Under ./rdiff-backup-data directory, you could search for all files ending
with '.missing' that should get you the list of files getting deleted.

Something like this should get you started: find ./rdiff-backup-data/ -name
'*.missing'

e.g.:
increments/home/ikus060/Documents/Icons/VMWare/16x16/devices.2017-08-16T13:00:18-04:00.missing

/home/ikus060/Documents/Icons/VMWare/16x16/devices: is the full path of the
file
2017-08-16T13:00:18-04:00 define when this files was deleted

--
Patrik Dufresne Service Logiciel inc.
http://www.patrikdufresne.com <http://patrikdufresne.com/>/
514-971-6442
130 rue Doris
St-Colomban, QC J5K 1T9


On Sun, Sep 15, 2019 at 4:06 AM Andreas Weber <[hidden email]> wrote:

> Dear all,
>
> is it possible to list deleted files and which increment first recorded
> the deletion? I tried to write a simple script but this gets very slow
> with many increments:
>
> #!/bin/bash -e
>
> inc_dates=($(rdiff-backup --list-increments "$1" | tail -n+2 | head -n-1
> | cut -d "." -f2))
> total=${#inc_dates[*]}
>
> for (( i=0; i<$(( $total )); i++ ))
> do
>   tmplist[$i]=$(tempfile);
>   rdiff-backup --list-at-time "${inc_dates[$i]}" "$1" | sort >
> "${tmplist[$i]}"
>   if [ "$i" -gt 0 ]; then
>     deleted=($(comm -2 -3 "${tmplist[$i-1]}" "${tmplist[$i]}"))
>
>     nr=${#deleted[*]}
>
>     if [ "$nr" -gt 0 ]; then
>       echo "$nr file(s) deleted between ${inc_dates[$i-1]} and
> ${inc_dates[$i]}:"
>       printf '%s\n' "${deleted[@]}"
>     fi
>
>   fi
> done
>
> Thank you, Andy
>
> PS: I also asked on serverfault 2 days ago:
>
> https://serverfault.com/questions/983941/list-deleted-files-from-rdiff-backup
>
> _______________________________________________
> rdiff-backup-users mailing list at [hidden email]
> https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
> Wiki URL:
> http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki
Reply | Threaded
Open this post in threaded view
|

Re: list deleted files from rdiff-backup

Andreas Weber
Hi Patrik,

Am 15.09.19 um 14:43 schrieb Patrik Dufresne:
> If I do understand your request, you want to list the files that was
> deleted from the source directory over all the increment known by
> rdiff-backup repository ?

Yes, exactly.

> Under ./rdiff-backup-data directory, you could search for all files
> ending with '.missing' that should get you the list of files
> gettingĀ deleted.

Thank you for the enlightment. I always treaded the rdiff-backup-data
dir as a black-box which shouldn't be touched or even looked into it.

One problem left: how can I unescape the ";077y;070ile" path name
(http://rdiff-backup.nongnu.org/FAQ.html#case_insensitive)

-- Andy

_______________________________________________
rdiff-backup-users mailing list at [hidden email]
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki