Linux Cron Job

I need to issue this command every minute from within /etc/crontab:
echo 3 > /proc/sys/vm/drop_caches

What is the line I need to add to /etc/crontab to make it work?

 * * * * root echo 3 > /proc/sys/vm/drop_caches DOES NOT WORK

and a number of other variants...

true expert needed on this one...
Who is Participating?
How are you determining it isn't working?
0,1,2,3  *  *  *  *  script
*/1  *  *  *  *  script

The format */1 is not supported on all platforms.

The * in the filed means all possible values for that field. Thus for the minutes field it will cover the whole range 0-59.

* * * *

is the correct/valid format for all Linux/Unix systems.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

why do you want to create the file in /proc/sys/vm ? I don't think you can create files there ! try to send it to /tmp or some other dir
SteveNetwork ManagerCommented:
ok.. try adding /bin/echo in front first.. if that dosent work then create a script like this :

/bin/echo 3 > > /proc/sys/vm/drop_caches

then add it to your cron script

0-59 * * * * /<location of script>/<scriptname>.sh

that will make it run every minute..

I tried to copy / create files under that dir on fedora 8 and it says that I can not create regular file
lvnvAuthor Commented:
umm...I'm giving you all 125 points to keep quiet...
it was my own fault...Late night dumb error...
crond was stopped...
turned it on and all is good...
thanks for your replies
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.