I have a little but very frustrating problem with my Nethserver instance:
I had personalised the DUC script to have the Disk Usage graphic without the /opt directory ( the /opt directory my Time Machine backup place)
But sometime there’s a nethserver update, my personalised script is swapped by the original one.
I began to work on exclusions. Do you recall I asked you for the exact syntax?
Unfortunately, I can’t find time, I’m sorry.
I’m not even sure that exclusions will work fine.
See
I know that you have a good knowledge about SME and Nethserver, but I really don’t understand why you persist to answer this way. It’s really counter productive.
If you know and don’t want to share your knowledge… Stay in your ivory tower, but don’t post unpleasant answer.
because when you install an update, the nethserver-duc-update won’t expand your custom template like @dnutan proposes and the action you have modified like @nas proposed has been updated by the new rpm.
Your only chance is to do a PR to github with the change you need.
so, IIUC, you edited /etc/e-smith/events/actions/nethserver-duc-index
which is an action, not a template
the only way to achieve your needs is to store the --exclude part/list in a db and then use it in the beginning of the action… you get the values from the db, you create the list using the right syntax and then you use it in the command line…
this is something not trivial
templates are there to templatize the config files… not the script ones
actions are script and you’d never edit it… first of all because you’ll miss your customization every time you update the rpm that owns that file
if you need custom actions to be executed during events, just add your script there, use different names, and link them in the desired event
so, at the end, to solve your issue that script must be modified to accept params from the db…
doing so, you can add as many exclusions you want… it doesn’t matter, 'cause the script will always be executed in the right way
Can I just copy the actual script, make the modification and save it in this place and this script will be alway the only script that will be executed by the system, even if there’s duc update occurring.
yours is not a custom action, but a system’s one…
so, please, follow Steph’s advice and ask for a PR… that script must be changed to work as you expect…
generally speaking everything that can be a parameter (and customized) should be stored inside the configuration db
for example:
db configuration set duc service excludeList /opt;/mydir/mydir2
then the duc script should retrieve those values and use them as parameters