I need to write a bash script that automatically deletes temp files, and runs in the background each day.
#!/bin/bash
while true;
do
rm /home/c/temp/*
sleep 24h
done
but it doesn't work
write a shell script
rm /home/c/temp/*
and add a line in the crontab
crontab -e
add the line
0 12 * * * path/to/script
It will execute you script every day at midday.