Skip to content

Switch NCS run dir to allow backup & restore

Kristian Larsson requested to merge 16-backup-and-restore into master

Restoring a backup with the built-in ncs-backup script fails as it tried to move the run dir, which was /nso, to /nso.old. As this is a shared volume (in case we want persistence for NSO), that would return an error. I've opted to solve this by placing the NCS run directory one directory level deeper, so that it is now /nso/run. Doing a restoration will thus move the current /nso/run dir to /nso/run.old and restore the one from the backup in its place.

Thus, ncs-backup appears to be working out of the box both for taking a backup and restoring from one. This is proven by a CI test.

On a normal system install, performing a backup using ncs-backup will include the config dir, which includes SSH keys and SSL certificates. As we are using different directories (/nso/ssh and /nso/ssl respectively), the keys and certificates are as a consequence NOT included in the backup file. This could be considered a good thing (such secrets are a tad dangerous to have in a backup file) but as it diverges from what ncs-backup does on a normal system install I think overall this is a bad thing. Not sure if we can do anything about it. I have at least documented the behaviour.

Closes #16 (closed)

Merge request reports