How to restore a previous version of a folder?

Dear all

I use Rclone (v. 1.47.0) on Linux (Mint 19.1 x64 Cinnamon). I have a folder on rclone, viz, <remote>/home/myUserName/.cinnamon. I want to restore an older version of that folder. I am confident that the previous version - well, perhaps more than one previous version - exits on the remote. (For, my remote is set to keep such items for a certain period.) How to restore it, via Bash? The folder is encrypted, so using my cloud providers web interface to browse files is useless. I have the program 'rclone Browser', but it seems not to show previous versions files.

I have now, er, read some of the relevant documentation (on rclone ls), and I have discovered how to list previous versions of items, by doing e.g.

rclone lsf enc-b2:X1/home/myUserName/.cinnamon/panel-launchers/ --b2-versions --max-depth 1

Or at least I think this lists previous versions. In the output I see, no item appears more than once and there is no indicated of any item being a non-current version . .

EDITED.

Thanks.

--b2-versions doesn't play particularly well with crypt unfortunately as the suffixes produces will cause crypt to skip over the files.

If you list the underlying bucket with --b2-versions then you'll see the crypted names along with suffixes of dates. What I recommend you do is copy the files you need to a local directory, remove the date sffixes, then point a crypt at that local directory to recover the files.

ncw: thanks.

So: I must (1) determine the date of the item(s) I wish to retrieve; (2) locate the files on my remote with that date; (3) copy any and all files with that date to some local directory; (3) remove the suffixes of those files; (4) 'point a crypt at that local directory to recover the files'.

This is pretty disastrous. For, it is so involved that it almost removes the point of having the backup. After all, sometimes - as indeed has just proved the case with me - it will be easier just to recreate the lost content (while nonetheless paying for the storage of previous versions).

Now, next, and if I may: what about (encrypted) items that are deleted but yet which are, by design, retained by the remote? How can one get at them, via rclone?

EDITED: a typo.

Yes that is correct.

I agree, it is a bad user experience. Really the versions feature of rclone needs to be implemented at a higher level. Or a different flag like --b2-version-at date/time which shows files which are no older than that time but doesn't add suffixes so hence place nicely with b2 versions.

The rclone way of doing this is to use --backup-dir and to turn off versioning on your b2 bucket.

Note you'll need the latest beta to use --backup-dir with b2 as it has server side copy support.

I added a bit to the b2 docs about this.

Note there is an issue about this already: https://github.com/ncw/rclone/issues/1627

The same way - when you use --b2-versions they will be visible in the underlying remote.

1 Like

The rclone way of doing this is to use --backup-dir and to turn off versioning on your b2 bucket.

Aha! This sounds like just the thing; excellent. I will use that. Thank you.

I think that now I have everything set up in my backup scripts to use the --backup-dir functionality, but now I need the rclone beta and I don't understand how to get it. I'm on Linux, I'm decent with Bash, but I have only the most basic fundamentals of git. Might someone help me get the beta? EDIT: Hold on, there are clear instructions. Thanks.

By the way: rclone is a brilliant tool.

1 Like

One more thing, if I may.

I have got the --backup-dir setup working, except that the old versions of files seem to end up at the root of the backup-dir. Let me explain.

The destination path for my backup: enc-b2:/X1/usr/bin/lib

My --backup-dir: enc-b2:/X1/X1_replaced/1406

The destination path contains a file that is being overwritten. It ends up here: enc-b2:/X1/X1_replaced/1406. Should it not end up in enc-b2:/X1/X1_replaced/1406/usr/bin/lib? Perhaps I have misunderstood.

Here is the command I am running:

RL_RCLONE_STRING is: sync /usr/bin/lib enc-b2:/X1/usr/bin/lib --drive-chunk-size=256K --log-level=NOTICE --checkers 13 --fast-list --local-no-check-updated --one-file-system --retries=2 --timeout=4m --tpslimit 0 --tpslimit-burst 1 --skip-links --transfers 32 --max-depth 30 --backup-dir=enc-b2:/X1/X1_replaced/1406 --bwlimit=2M --log-file /tmp/tmp.wI5rIZoavI -P --stats=0 --stats-one-line

No it will end up in the dest path you specify with the structure under that path. If you want it in the deeper structure you should add that structure to the backup dir.

1 Like

Aha. I think I get it. Thank you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.