restic
restic copied to clipboard
Put restic mount into background after mount is successful
Output of restic version
restic 0.9.6 compiled with go1.13.6 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
Add a flag (or make the default) for restic mount whereby it mounts the backup repository, and upon success, exits with mounted folder ready to use. When finished using the repo, instead of killing the restic mount process, one would simply unmount the directory.
Actually, though it is not backward compatible, I'd suggest that it is worth changing restic mount
to always exit successfully as soon as the mount is ready, and print the message "When finished, unmount the mountpoint /backup." just before exiting, instead of "When finished, quit with Ctrl-c or umount the mountpoint."
Or you could add flags --background
and --no-background
(--fork
? --daemon
?) and make the appropriate one the default as folks like.
I suppose messages from restic mount that get generated after the mount is done would have to be directed to somewhere. I'd expect, by default, they'd go to syslog, but I don't know what the portable solution is.
What are you trying to do?
To immediately use the mounted repo once it is successfully mounted:
# if restic mount /backup ; then rsync -a /backup/hosts/_myhost_/latest/home /home; fi
# umount /backup
Note that restic mount /backup </dev/null 2>/var/log/restic.log &
doesn't work, since (a) I don't know where the mount was successful, and (b) the next command starts before the mount is established.
Did restic help you today? Did it make you happy in any way?
I love restic, and it makes me happy every day. Really. (Thank you for putting it out there)