I unfortunately have no choice but to backup some files from a ext3 parition on a server to a filesystem which does not allow me to set and edit the normal file attributes (NFS, with all_squash set so chgrp/chown etc. even as root is forbidden). I'm planning on using rsnapshot for the actual backups, since I'm already familiar with this and it's worked well in other scenarios.
Clearly I would like permissions, ownership and other attributes to be retained in someway for these backups, even if it's not directly with the files themselves. As I see it that leaves three options:
- Create a loopback filesystem on the remote NFS space.
- Dump the other attributes separately.
- Use a FUSE filesystem as an overlay which fakes this, by writing to /backup/.permissions/ or some other extra file.
None of these are ideal:
- I wanted to make the use of the external filestore use automount, but automount does not allow recursive mounts like this (to the best of my knowledge).
- this doesn't seem terribly easy to do using shell scripts. Using
find
+stat
would be somewhat wasteful, but more importantly restoring from that information would be fiddly. I could write a small tool (in C) to callstat
, dump the struct to a file and restore the appropriate information from that struct, but this seems like a lot of work for something which ought to be trivial. - I'm surprised nothing exists which already does this, but I can't seem to see anything appropriate on this list of FUSE filesystems, which I assumed to be quite authoritative.
Suggestions? I'm leaning towards solution #3, unless it already exists or #2 is more trivial that I thought. I want something simple and robust which doesn't require reinventing any wheels, however I am willing to write new wheels if they're genuinely useful.