duplicity-talk
[Top][All Lists]
Advanced

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

Re: [Duplicity-talk] Restart duplicity without private key


From: edgar . soldin
Subject: Re: [Duplicity-talk] Restart duplicity without private key
Date: Thu, 19 Jun 2014 15:19:48 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 19.06.2014 15:10, Radomir Cernoch wrote:
> 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? 
> 

no it is not.. this was meant as a workaround. not an automatism. generally 
speaking if restarting fails and you don't care you simply delete all files 
belonging to the last backup in the repository. _manually_

everything else
- detection of incomplete backups for cleanup
- an option to tell duplicity never to restart
belongs in duplicity. it simply has to be hacked by someone ;)

also. if you keep machine private keys the whole deletion of incomplete backups 
becomes academic anyway.

..ede/duply.net






reply via email to

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