duplicity-talk
[Top][All Lists]
Advanced

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

Re: [Duplicity-talk] Restoring from the last full backup (Re: Difficulti


From: andrew
Subject: Re: [Duplicity-talk] Restoring from the last full backup (Re: Difficulties with restore: 'Could not restore the following files. Please make sure you are able to write to them.')
Date: Tue, 16 Nov 2021 09:49:58 +0000
User-agent: Roundcube Webmail/1.4.2

Hi Jeff,

Thanks for this.

For my own use case: workstation at home - which is many other peoples too, then it occurs to me that the most sensible time that if the backup was created just before shut-down or at shut-down then that might avoid conflicts with running programmes. While this is outside of the scope of duplicity I guess, it's not outside the scope of Deja-vu (backup on Fedora and maybe Gnome too).

While running at shut-down wouldn't guarantee no conflicts, it's likely to removed most of them. Further, it would be sensible to schedule a verify every so often. In the event that verification fails then other than perhaps re-running, halting shut-down maybe, and alerting the user, there isn't much that can be done. Some kind of user intervention is required at that point.

Any thoughts? This must have been discussed before? Thank-you.

Best wishes,

Andrew

Andrew Wood, Oxford.

- o -

On 15/11/2021 21:59, Jeffrey Walton wrote:
On Mon, Nov 15, 2021 at 5:05 AM andrew via Duplicity-talk
<duplicity-talk@nongnu.org> wrote:

How do I force duplicity to restore from the last full backup which it
made? I can see the options for creating a new full back-up but not
restoring it. Indeed, how do I find out when the last full backup was
made.

To state the [non?] obvious, you have to know when the last full
backup was created. Then you can restore from that particular date.

To keep a "restore from full backup" simple, I use the following
recipe that runs each night. It performs a full backup on JAN 1, APR
1, JUL 1, and OCT 1:

# Determine if we need a full back. We do a full backup every three months.
day=$(date +%d)
if [ "${day}" = "01" ];
then
  month=$(date +%m)
  case ${month} in
    01|04|07|10)
      full_backup=full
      ;;
    *)
      ;;
  esac
fi

if [ -n "${full_backup}" ]; then
  echo "Performing a full backup"
fi

day=$(date +%d)
if [ "${day}" = "01" ];
then
  month=$(date +%m)
  case ${month} in
    01|04|07|10)
      full_backup=full
      ;;
    *)
      ;;
  esac
fi

if [ -n "${full_backup}" ]; then
  echo "Performing a full backup"
fi

...
if ! duplicity ${full_backup} --allow-source-mismatch
${exclude_opts[@]} ${root_drive} <sftp options>;
then
  echo "Failed to backup VM"
  exit 1
fi

The code above is slightly different than "every 90 days" since the
script always performs a full backup on the 1st. Because the full
backup is always on the 1st, it is easy to find when it comes time for
a restore.

Jeff



reply via email to

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