Caution! Article for developers

Information on this page is intended particularly for users with advanced technical knowledge.

Treon Gateway Update - Persist move

Sep 6, 2023 · 2 minutes to read

Treon Gateway Treon Gateway 2 Treon Gateway in Protective Enclosure

Normally files stored on the Treon Gateway are not persistent between updates. This means, that when the Treon Gateway’s firmware has been updated, most files will also be wiped and be unrecoverable. This can be circumvented with the use of persist_move.

persist_move is a utility in the Treon Gateway which can move files or folders to persistent storage, which keeps persistent over the gateway’s firmware updates. This can be implemented by moving files and folders to a persistent user partition and by creating symlinks from their old location to the new. This is done by a service called gw-system-persist, which runs on every boot.


What files are persistent

By default files stored in the OS partition are not persisted between updates. For end user access, files stored in /home/ are persistent. Similarly the cloud configuration files in /opt/iotgw/conf.d/ are persistent.

Creating persistent files

You can create persistent files by creating them in the /etc/persist.user.d-folder1. These files should contain bash with persist_move <target> where the target is an absolute path to the file or folder which is to be persist-moved. These files support bash syntax and it is possible to e.g. have if-statements and for-loops in them.

Please Note: When creating persist files, the Treon Gateway should always be rebooting after creating new persist configs to /etc/persist.user.d. If the gateway is not rebooted and then updated, the files will be lost. This is caused by the service not being run and the files not being copied to persistent storage before update.

  1. /etc/persist.user.d is a persistent folder. ↩︎


Treon Support

You still have questions? Our dedicated team of experts is happy to help you! Please contact Treon Support directly by e-mail.

Did you know? Treon offers Premium Support and Maintenance Packages for our customers. Get even more out of Treon and boost your sales - inquire now about features and prices!


Was this article helpful? Let us know.