Click to See Complete Forum and Search --> : cron problem (once again ;-))


[Mystik_Cool]
10-14-2001, 10:31 AM
I know there are a lot of howto, man pages and topic on this forum about cron, but my problem is quite... different and I didn't find the solution in reading all that.

I wrote a little prog in C++ to check if I'm connected, and if I'm not then it reconnects me and mail me my new ip.
I wanted this to run every 5 minutes, so I wrote a crontab like this :
5,10,...,55 * * * * root /bin/sh /connect/reconnect
(the program I want to run is in /connect/reconnect).

But now, every 5 minutes, I get a message saying : "linux modprobe : modprobe : can't locate module net-pf-10".

When I run my program manually, everything works fine.

What's the problem ? Do I need to install this module ? If yes, how ? (I'll certainly have to recompile then, so when I ask "how" I simply mean which option should I add in my kernel configuration ?)

Thanx !

PS: if you need the source of the C++ program I want to run, simply say it...

X_console
10-14-2001, 01:52 PM
If it's a C++ executable, then you don't have to call sh to run it:

*/5 * * * * /connect/reconnect

Try that.

[Mystik_Cool]
11-13-2001, 07:05 PM
(sorry for the late, I've been really busy these times...)

So I tried exactly what you did, and I still get exactly the same error msg, every 5 minutes...
Any idea ? Maybe I should write a shell script to start my C++ executable and run the shell script every 5 minutes ? If yes, I don't have any idea about how to do that (never wrote in bash... I presume I should simply write "/connect/reconnect" in the file, but then my system doesn't transform it into a shell script, and I don't know how to do that ! :rolleyes: )

Thx !

PS: waouw, it seems to work... sometimes... and not as it should... and still the error message in the console...

[ 13 November 2001: Message edited by: [Mystik_Cool] ]

[Mystik_Cool]
11-13-2001, 07:15 PM
I'm so stupid...

I think I have found where the problem comes from :

The prog (in C++) that I want to run NEEDS to be run as root (for example, there are commands like "reboot" in it, and as simple user it prints out "reboot : command not found"). But what I want is that the progs runs every 5 minutes, even if I'm not connected as root (as a simple user for example).
I know the crontab command looks like
crontab -u user filename

But how should I do that to obtain the result I hope ?

Thx a lot and sorry for useless post before...

[ 14 November 2001: Message edited by: [Mystik_Cool] ]