Re: Restore the most recent version of a file/directory?

"edgar.soldin--- via Duplicity-talk" <[email protected]>
Newsgroups gmane.comp.sysutils.backup.duplicity.general
Message-ID <[email protected]>
hola tink,

SNIP
>
>      > how do I get the most recent version of a file? I've played with -t options (or leaving them off all together), but I always get one particular file in the version of Aug 15th rather than e.g. Nov 11th.
>
>     well. usually you
>     1. start by listing backups with `collection-status` which will give you a time stamped list of backups.
>     2. use a time stamp that lies between two backups or the exact (not rly needed) to "select" the younger backup to restore from via `--time` option
>
> OK, so I tried to follow those steps just then and still got the "August" file.
>
>     please post your collection status,
>
> duplicity  --s3-endpoint-url https://s3.ZZZ-YYY-2.wasabisys.com <https://s3.ZZZ-YYY-2.wasabisys.com> collection-status "s3:///XXX/backups"
> Collection Status
> -----------------
> Connecting with backend: BackendWrapper
> Archive dir: /root/.cache/duplicity/22d8d156708c5411aeb8a9162002c073
>
> Found 2 secondary backup chain(s).
> Secondary chain 1 of 2:
> -------------------------
> Chain start time: Fri Aug 30 08:44:08 2024
> Chain end time: Thu Sep 26 14:43:53 2024
> Number of contained backup sets: 6
> Total number of contained volumes: 34782
>   Type of backup set:                            Time:      Num volumes:
>                  Full         Fri Aug 30 08:44:08 2024             17086
>           Incremental         Thu Sep  5 09:54:00 2024               166
>           Incremental         Fri Sep 13 11:10:05 2024               156
>           Incremental         Thu Sep 19 09:00:03 2024                 1
>           Incremental         Mon Sep 23 10:25:25 2024             17185
>           Incremental         Thu Sep 26 14:43:53 2024               188
> -------------------------
>
> Secondary chain 2 of 2:
> -------------------------
> Chain start time: Thu Oct  3 09:45:02 2024
> Chain end time: Thu Oct 31 09:06:23 2024
> Number of contained backup sets: 6
> Total number of contained volumes: 17988
>   Type of backup set:                            Time:      Num volumes:
>                  Full         Thu Oct  3 09:45:02 2024                 1
>           Incremental         Thu Oct  3 10:26:40 2024             17382
>           Incremental         Thu Oct 10 09:04:12 2024               147
>           Incremental         Thu Oct 17 09:04:06 2024               153
>           Incremental         Thu Oct 24 09:04:09 2024               149
>           Incremental         Thu Oct 31 09:06:23 2024               156
> -------------------------
>
>
> Found primary backup chain with matching signature chain:
> -------------------------
> Chain start time: Fri Nov  8 13:33:03 2024
> Chain end time: Thu Nov 14 09:06:26 2024
> Number of contained backup sets: 2
> Total number of contained volumes: 17820
>   Type of backup set:                            Time:      Num volumes:
>                  Full         Fri Nov  8 13:33:03 2024             17665
>           Incremental         Thu Nov 14 09:06:26 2024               155
> -------------------------
> Also found 0 backup set(s) not part of any chain,
> and 3 incomplete backup set(s).
> These may be deleted by running duplicity with the "cleanup" command.
>
> Out of the above I was hoping to get yesterday's backup

ok, than a simple restore without any `--time` argument should suffice as that was your latest most current backup.

>
>     restore command lines and their outputs for us to see what is goin on.
>
> duplicity \
>     -v d \
>     --s3-endpoint-url https://s3.ZZ-YYY-2.wasabisys.com <https://s3.ZZ-YYY-2.wasabisys.com> \
>     --progress \
>     -t 1D \
>     restore  --path-to-restore postgres.domain.com <http://postgres.domain.com>  \
>     "s3://XXX/backup" \
>     /tmp/restoretest/

please run without debug verbosity unless asked explicitely.

wrt. `--time 1D` means one day ago. assuming you ran the above command somewhen after "Thu Nov 14 09:06:26 2024" but before "Fri Nov 15 09:06:26 2024" the one day would ask duplicity to restore the state from one day ago, which would be the backup "Fri Nov  8 13:33:03 2024" the newer "Thu Nov 14 09:06:26 2024" wasn't created at that time already.

> GPG binary is /usr/bin/gpg, version 2.2.19
> Import of duplicity.backends._testbackend Succeeded
> Import of duplicity.backends.adbackend Succeeded
> Import of duplicity.backends.azurebackend Succeeded
SNIP
> Found manifest volume 259
> Found 259 volumes in manifest
> Registering (mktemp) temporary file /tmp/duplicity-zpbpo2mo-tempdir/mktemp-gbuiy95w-4
> Writing etc of type dir
> Making directory /tmp/restoretest/etc
> Writing etc/.pwd.lock of type reg
> Writing etc/NetworkManager of type dir
> Making directory /tmp/restoretest/etc/NetworkManager
> ... thousands of lines trimmed ...
> Forgetting temporary file /tmp/duplicity-zpbpo2mo-tempdir/mktemp-j8vteb0p-16
> Processed volume 39 of 17762
> Registering (mktemp) temporary file /tmp/duplicity-zpbpo2mo-tempdir/mktemp-1ny_z079-41
> Writing var/backups/postgres/tuakiri_confluence_test-2023-12-12.sql.gz of type reg
> Deleting /tmp/duplicity-zpbpo2mo-tempdir/mktemp-1ny_z079-41
> Forgetting temporary file /tmp/duplicity-zpbpo2mo-tempdir/mktemp-1ny_z079-41b
> Processed volume 40 of 17762
> Registering (mktemp) temporary file /tmp/duplicity-zpbpo2mo-tempdir/mktemp-pmpno7cs-42
> Writing var/backups/shadow.bak of type reg
> Deleting /tmp/duplicity-zpbpo2mo-tempdir/mktemp-pmpno7cs-42
> Forgetting temporary file /tmp/duplicity-zpbpo2mo-tempdir/mktemp-pmpno7cs-42
> Processed volume 41 of 17762
> Releasing lockfile /root/.cache/duplicity/f24ae946dd6e7152fe8bd268761fc94c/lockfile
> Removing still remembered temporary file /tmp/duplicity-zpbpo2mo-tempdir/mkstemp-4py0cg8c-1
>
> So it looks like it only picks up the oldest backup even though
> Full         Fri Nov  8 13:33:03 2024             17665
> is listed?

i would need actual file listings `ls -la` with the corresponding `duplicity restore` commands here to see what was restored with which time stamps to evaluate your conclusion.

again, you requested to have the timestamp "1 day" ago restored and that seems to have happened.

btw. did you take a look at https://duplicity.us/stable/duplicity.1.html#time-formats already?

sunny regards ..ede





_______________________________________________
Duplicity-talk mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.