Automatic grain backups? (Or, allowing non-owners to back them up.)

14 views
Skip to first unread message

James Cook

unread,
Nov 18, 2020, 9:42:12 PM11/18/20
to Sandstorm-dev
Hi sandstorm-dev,

I've shared a wiki with some others, and to make sure it doesn't get
lost, I'd like to either (a) save automatic backups of it somewhere,
or (b) allow other users to download grain backups.

Is there a simple way to do either? For (a) I could set up a cron job
to save a copy of /opt/sandstorm/var/sandstorm/grains/{...} but I
don't know if that's reliable, especially if the grain is being edited
while the archive is being created. If there's some command I could
run on the host that creates a grain backup that would be perfect.

It would also be nice if others could download backups, rather than
just me as the grain owner. Assuming that's not implemented, my plan
is to put the periodic grain backups somewhere they can get them, once
I have a solution to (a).

James

Jacob Weisz

unread,
Nov 18, 2020, 10:25:51 PM11/18/20
to sandst...@googlegroups.com
Unfortunately we don't have a fantastic backup story ready yet. Ian is working on a lot of things that will lead to more robust backup capabilities.

Trying to back up grains yourself while Sandstorm is running could definitely lead to corruption. Until recently, this was true for backups taken by Sandstorm itself as well. (https://github.com/sandstorm-io/sandstorm/issues/3186) But if you have a new enough kernel (Linux 5.0+), you get safe backups using the download backup button.

Issues for things you are asking for are mostly here:
https://github.com/sandstorm-io/sandstorm/issues/1647
https://github.com/sandstorm-io/sandstorm/issues/1324

Also, in the comments of https://github.com/sandstorm-io/sandstorm/issues/1703 I discuss that ideally the ability to clone and backup grains should be a permission the owner can delegate to users, though I don't think we have a tracking issue just for it at this point.

--
Jacob Weisz
goo...@jacobweisz.com
> --
> You received this message because you are subscribed to the Google
> Groups "Sandstorm Development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sandstorm-de...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sandstorm-dev/CAHpmPOAz%2BMuZMTGX36A-DRZRkgcrJXFVLJ5W7cNAEbPDX28yfQ%40mail.gmail.com.
>

Ian Denhardt

unread,
Nov 19, 2020, 4:45:51 PM11/19/20
to Jacob Weisz, sandst...@googlegroups.com
Quoting Jacob Weisz (2020-11-18 22:25:29)

> Trying to back up grains yourself while Sandstorm is running could definitely lead to corruption. Until recently, this was true for backups taken by Sandstorm itself as well. (https://github.com/sandstorm-io/sandstorm/issues/3186) But if you have a new enough kernel (Linux 5.0+), you get safe backups using the download backup button.

A couple ways you could work around this for now:

- Shut down sandstorm before doing the backup. This might be suitable if
your users aren't going to be accessing the system at 4am or some
suitable time.
- Install sandstorm on a filesystem that supports snapshots (e.g.
btrfs), and take a snapshot rather than using `cp -r` or the like.

The backup story is I think one of the biggest weak points as far as
administering a Sandstorm box right now. As Jacob mentions, I'm working
on some things, but they're very much a long-term projects, so in the
meantime I'm sorry there's not a better approach.

-Ian

James Cook

unread,
Nov 25, 2020, 6:05:33 PM11/25/20
to Ian Denhardt, Jacob Weisz, Sandstorm-dev
Thanks, Ian and Jacob. Fortunately, the filesystem supports snapshots,
so I should be able to figure something out.

(In the end, my aged relatives gave up on trying to understand
MediaWiki, so this may all be moot.)

James
Reply all
Reply to author
Forward
0 new messages