I have to perform a number of 'housekeeping' tasks that need root access (Linux, Debian). Generally one time only, but I do need to check that they have been performed.
I don't really want to run the whole program as root though. Is there a good pattern to do these tasks without having the whole program as root?
The tasks are fixed and have no inputs from outside the system (IE no user inputs are needed). Some known tasks include changing the hostname and formatting an SD card.