[Hampshire] Cron script spawning too many programs?

Top Page

Reply to this message
Author: AdamC
Date:  
To: hampshire
Subject: [Hampshire] Cron script spawning too many programs?
Can anyone think of a reason why when cron executes a script many more
programs start (at least over 5), but when I run the script from a
shell, I get the correct amount of programs running that I am
expecting?

I have a small script (see below) that scans a directory for .torrent
files and then starts a btdownloadcurses instance for each file. If I
start the script from the shell, and I have 2 .torrent files in that
directory, then I get 2 instances of btdownloadcurses running.

However, if cron runs this script then I get a lot more
btdownloadcurses running than I expected and it pretty much makes the
nslu2 crawl along (until I manage to kill the processes).

Any thoughts what might be going on here?

Thanks
Adam

#!/bin/sh
for i in $(ls *.torrent);
do
/usr/bin/btdownloadcurses $i > /dev/null &
done