Hello, how can i create a cron job that runs every five minutes and does this:
cd /tmp; rm -rf p*.*;
Hello, how can i create a cron job that runs every five minutes and does this:
cd /tmp; rm -rf p*.*;
Create a file say, 'deltempfiles' under any directory and insert the following lines :-
#!/bin/bash
cd /tmp;
rm -f p*.*;
Save the file and chmod it to 755.
Edit the cron file for root at /var/spool/cron/root or just do crontab -e
and set the cron as :-
5 * * * * /Path/to/deltempfiles
Save the file and restart cron service :- service crond restart