FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
04-20-2022 11:35 PM
During installation of a snap, I would like to automatically copy a file from my snap in "/snap/APP-NAME/x1/" to "/var/snap/APP-NAME/x1/". How can this be done?
Solved! Go to Solution.
04-21-2022 04:12 PM
Hello,
if you want to copy files at an installation phase of your snap please have a look at hooks. See: supported snap hooks form snapcraft. I think the configure hook or the install hook could fit your need.
Please also have a look at this thread. The poster does a interface hook which copies data to the active configuration when the interface is connected. The interface hook gets executed at a different time, as the configure or the install hook but is very similar to them.
But maybe it could also be a way to store your data in the active configuration, depending on your use case.
Best regards,
Nick
04-25-2022 01:50 PM
See also this thread where the hook topic was discussed already for further information.