I've made a script which just empties a folder from its contents and then shutdown the pc.
I was wondering if there is a simpler way of doing that automatically when I shutdown or reboot the pc instead of calling the script from the command line. While searching, I found that I probably want a systemd service, but I don't know how to write one and I couldn't find any tutorials on the internet.
After all I just want to run simple single command
rm -rf /my/folder/*
Am I looking the right way, or is there a simpler way to accomplish this?
I want the folder to empty before shutdown and not after the next boot.