[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Duplicity-talk] Restart duplicity without private key
From: |
Radomir Cernoch |
Subject: |
Re: [Duplicity-talk] Restart duplicity without private key |
Date: |
Thu, 19 Jun 2014 15:10:37 +0200 |
Thu, 19 Jun 2014 13:36:20 +0200 address@hidden:
> >> as a workaround you can delete the unfinished backup's files
> >> manually on your backend. the files are neatly named with date.
> >> run a verify afterwards to be sure.
> >
> > Huh. I feel extremely anxious about executing "rm [whatever]" in the
> > backup directory using my own (therefore badly tested) code.
> > Or is there a 100% safe pattern to remove an incomplete backup only?
>
> it is 100% safe if you look out what you do ;).. if in doubt move the
> files out of the way instead of deleting them right away.
>
> have a look at your backup repository. file names and creation times
> will speak for themselves.
I never thought that duplicity's main documentation is the file
creation time. :)
But seriously speaking, how do I recognize an interrupted backup?
And which files should I delete/remove?
My first script checks a) file's ctime and b) retains the file only
if the timestamp in the filename has a corresponding manifest-file.
From my (admittedly shallow) understanding, I would do something like
#!/bin/bash
manifests() {
stat -c '%Y %n' *manifest* |\
sed 's/\.manifest.*//' |\
sed 's/ .*\./ /'
}
if [ `manifests | wc -l` -eq 0 ]; then
mkdir -p trash/ && mv * trash/
else
LAST_TIME=`manifests | sort -n | tail -1 | cut -d ' ' -f 2-`
TO_DELETE=`find ./ -newer "$LAST_TIME"`
for PATTERN in `manifests | cut -d ' ' -f 2`; do
TO_DELETE=`echo "$TO_DELETE" | grep -v .to.$PATTERN`;
TO_DELETE=`echo "$TO_DELETE" | grep -v -full.$PATTERN`;
TO_DELETE=`echo "$TO_DELETE" | grep -v -full-signatures.$PATTERN`;
done
mkdir -p trash/ && mv $TO_DELETE trash/
fi
Honestly, I don't feel like putting this on production server.
Is this a good idea at all? Or is there an easier way?
Radek
[Duplicity-talk] Why 'duplicity without private key' is a bad idea - WAS: Restart duplicity without private key, edgar . soldin, 2014/06/19