Crontab No such file or directory

I keep getting the crontab No such file or directory error message.

0,30,31,32,33,34,35,36,37,38,39,40 * * * * "/bin/ps aux --sort -\%mem >> /home/m/bob/cookies"

I have made sure my directory exists.

find /home/m/bob -iname 'cookies' 2>/dev/null
/home/m/bob/cookies

I am using the full path with ps.

I have backslashed the % sign. I don't know what else to do.

Unless:

/bin/ps aux --sort -\%mem >> /home/m/bob/cookies

is the name of a file that you want cron to execute for you, remove the double quotes.

Putting it in quotes tells it to look for the file named ps aux --sort -\%mem >> /home/m/bob/cookies inside /bin/ :slight_smile:

It worked :).

0,15,16,17,18,19,20,30 * * * * /bin/ps aux --sort -\%mem | head >> /home/m/bob/cookies
1 Like