OK, I found a solution to this problem. I'm posting this, because it might be useful for other people in more general terms. I added a 'set' to the script and check to see what the difference in the environment variables was between running it manually, and running it under crontab. Several things were different, but the key turned out to be the current working directory, which was /root under cron, and the script's directory for manually running.

Adding a 'cd' to the script directory at the start of the script solved the problem. The general point is that if you get different behavour when you run a script unde crontab, then look at the environment variables for differences!

alan

alan lenton wrote:

Hi,

I'm using BusyBox with OpenWrt, and I have a strange problem, which I was wondering if anyone else had encountered.

I have written a C/C++ program which uses the curl libraries to test the speed of a broadband line. If I run the program manually via a shell script it produces plausable results. However, if I add it into the crontab to run the script automatically, I get figures which are consistently around 10Mbits slower than when I run it by hand!

This is a kinda show-stopper, and I was wondering if anyone had encountered anything like this before, or had any suggestions about what the problem might be.

Alan Lenton

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to