Veteran Member
Posts: 5,456
Registered: ‎03-12-2011
Kudos: 2746
Solutions: 129

Preserved paths

On OpenWRT there is a rather nifty little feature where you can specify paths to be preserved across an upgrade.


I was about to hack up a little script to do this but I thought I'm sure this would be useful for other people too and wondered if there's any chance of getting this done "properly" with vyatta CLI configuration options to specify files/paths and included in a future release.


Logic would be fairly simple, detect when an upgrade has occurred (test if a file exists that isn't in the image, bail if it does, create otherwise), then go through and copy said files/directories from / I'm guessing most of this logic already exists somewhere for persisting /config and the like, any idea where?

Previous Employee
Posts: 13,551
Registered: ‎06-10-2011
Kudos: 5474
Solutions: 1656
Contributions: 2

Re: Preserved paths

Yeah something like this has been discussed before and we should be able to implement some kind of post-upgrade mechanism to preserve user customizations, for example, copying files, creating symlinks pointing to files in persistent location, installing packages, etc.


The upgrade script is "/usr/bin/ubnt-upgrade" and as you can see it copies the /config directory etc. near the end. This is not very flexible of course and a more generic mechanism (for example maybe similar to the post-config.d mechanism for running scripts on boot) would probably be better.