Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Linux Cron Job

Posted on 2009-02-17
7
Medium Priority
?
541 Views
Last Modified: 2013-12-15
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...
0
Comment
Question by:lvnv
7 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 23667132
How are you determining it isn't working?
0
 
LVL 4

Assisted Solution

by:ValleyENT
ValleyENT earned 500 total points
ID: 23667139
0,1,2,3  *  *  *  *  script
or
*/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.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 23667152
ValleyENT

* * * *

is the correct/valid format for all Linux/Unix systems.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 500 total points
ID: 23667212
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
0
 
LVL 12

Assisted Solution

by:Steve
Steve earned 500 total points
ID: 23667215
ok.. try adding /bin/echo in front first.. if that dosent work then create a runme.sh script like this :

#!/bin/sh
/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..

0
 
LVL 40

Expert Comment

by:omarfarid
ID: 23667225
I tried to copy / create files under that dir on fedora 8 and it says that I can not create regular file
0
 

Author Closing Comment

by:lvnv
ID: 31548145
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
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question