I have a folder that I want cleared every hour when I am logged in.
I added a .desltop file that points to my shell script shell in the /home/user/.config/autorun
Note: Replace username with the actual user's userID
You can also modify the path to your scipt as you desire.
--- example of desktop file ---
[Desktop Entry]
Comment[en_US]=
Comment=
Encoding=UTF-8
Exec=/home/**username**/bin/setx
GenericName[en_US]=
GenericName=
Hidden=false
Icon=computer-laptop
MimeType=
Name[en_US]=Set X video
Name=Set X video
Path=/home/**username**/bin
StartupNotify=false
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
--- end of desktop file ---
in my script I do whatever is necessary but first I lock it in a loop
when the script hits the sleep command it will sleep for N seconds
example: sleep 60
Will sleep for 1 minute.
(please not that the code below is pseudo and not tested)
while [ true ]; do
dosomething
sleep [number of seconds to sleep for]
done