This tutorial shows how to automatically create, delete files/folders, and/or write parameters into config files at startup in Ubuntu and other Linux using systemd.
This can be useful if some configuration do not persistent and reset to default on every boot, or you want to clean up something either on every boot or after every time period.
Advanced users can manually create a script, and run it via either crontab schedule task or custom systemd service. But, here I’m going to show you how to do the trick using tmpfile.d
, a built-in configuration for creation, deletion and cleaning of volatile and temporary files.