You are not logged in.

#1 2010-07-23 20:47:37

begbie
Member
From: Poland
Registered: 2010-04-28
Posts: 39

[SOLVED]Script to run every 30 minutes.

Forgive any mistakes in subject or message. I guess this is the right place.

Around every 30-50 minutes (depends on uptime) I have to run command "echo 3 > /proc/sys/vm/drop_caches" as root to "clean" my memory (I wrote about that in other section of forum).
I once wrote a script for conky to invoke hourly (which didn't work everytime, but whatever), so I was wondering if it's possible to make script that run's itself every 30 minutes.

Second problem is that I can't run that "sudo <command>" because I receive "access denied". I have to log in as root (with su command, but I guess it's obvious) and then run this command.

So can I do it so this command will work every 30 minutes when I'm logged in as normal user, not root?

Thank you for your time and replies.

Last edited by begbie (2010-07-23 21:35:50)

Offline

#2 2010-07-23 20:51:55

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED]Script to run every 30 minutes.

add

*/30 * * * * echo 3 > /whatever

to root's crontab

Offline

#3 2010-07-23 21:13:00

begbie
Member
From: Poland
Registered: 2010-04-28
Posts: 39

Re: [SOLVED]Script to run every 30 minutes.

It works perfect. Thanks brisbin33.

That's the difference between Arch and Ubuntu community. In second one, I would wait around week for reply (wrong one). big_smile

Last edited by begbie (2010-07-23 21:35:31)

Offline

#4 2010-07-23 22:30:38

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,923
Website

Re: [SOLVED]Script to run every 30 minutes.

In defense of the Ubuntu community, I must say, you are wrong. The Ubuntu community is very active, I hardly have to wait 10 minutes for answers there.


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#5 2010-07-24 00:00:23

begbie
Member
From: Poland
Registered: 2010-04-28
Posts: 39

Re: [SOLVED]Script to run every 30 minutes.

I was ironic. wink I respect Ubuntu community. I meant overall knowledge of users, you must admit that Arch force to learn some things.

And obviously I had worse experience with them than you. And maybe Ubuntu community is actually too huge for me? Sometimes it's not easy to find really competent user.

Last edited by begbie (2010-07-24 00:03:11)

Offline

#6 2010-07-24 10:13:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Script to run every 30 minutes.

> And maybe Ubuntu community is actually too huge for me? Sometimes it's not easy to find really competent user.
Become a really competent user yourself and than we can talk.

Offline

#7 2010-07-24 17:00:51

begbie
Member
From: Poland
Registered: 2010-04-28
Posts: 39

Re: [SOLVED]Script to run every 30 minutes.

By competent I mean with more knowledge than mine. I hope I can be competent (to help the other)  some day.

I didn't want to offence any member of Ubuntu community, and I hope I didn't offence anyone. wink I was Ubuntu user for long time. I just enjoy Arch far more.

We are all one big community of free people after all.

Last edited by begbie (2010-07-24 17:03:15)

Offline

Board footer

Powered by FluxBB