rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[rdiff-backup-users] list deleted files from rdiff-backup


From: Andreas Weber
Subject: [rdiff-backup-users] list deleted files from rdiff-backup
Date: Sun, 15 Sep 2019 10:06:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]