command faster in crontab..

Hi all you enlightened unix people,

I've been trying to execute a perl script that contains the following line within backticks:

`grep -f patternfile.txt otherfile.txt`;

It takes normally 2 minutes to execute this command from the bash shell by hand.
I noticed that when i run this command from crontab.. it's much more faster... within 10 seconds the file is created... i'm trying to solve this issue.. do you have any clues??

Thx

F

One possibility I can think of - the cron job is running at high priority. Another possibility is that the job runs at off hours when the system-wide I/O load is a lot less then during the day when you run your command from the prompt...

Hmm, yes i did a check on the priority with top and they both have priority 20, and i executed both commands with the same load on the server. The grep results are the same.. very strange