Results 1 to 2 of 2
Thread: Cron job programming help
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Apr 2006
Cron job programming help
The first point to remember with cron is that it has a shorter $PATH than most things, so you often have to specify a command's $PATH. In other words, if, for example, in FreeBSD, I have a script that I run from cron, that has a path of /usr/local/bin/ I have to specify /usr/local/bin/<program> in the script, or cron won't be able to find it.
As for your script, assuming that these files all start with the word core, and you have no other files with the word core in them, the following should work
find / -name "*core*" | xargs rm -f
You can test it first by changing xargs rm -f to xargs echo rm -f
Hopefully, your question is how to find and remove the files rather than how to set up a cronjob.
If the question is more about how to set up a cronjob rather than how to find and remove the files, you can take a look at this page on getmail for a better explanation about cronjobs.