Updated trans_watchdog
Forum » Forum / Torrent programs » Updated trans_watchdog
Started by: fraterfrater
On: 1238518171|%e %b %Y, %H:%M %Z|agohover
Number of posts: 62
rss icon RSS: New posts
Summary:
A shell script to manage transmission downloads
Updated trans_watchdog
fraterfrater 1238518171|%e %b %Y, %H:%M %Z|agohover

You can download latest trans_watchdog here…..
http://wd.mirmana.com/trans_watchdog
Install it as 1-minute cronjob (it will only run the full script every 10 minutes)

Because I recently installed it on an Asus WL-500g Deluxe (a router with a 1 TB USB harddisk) I had to make some modifications to make it more portable.

It is advisable to install the coreutils and findutils from optware as the standard busybox tools don't support all features I'm using.

Some additional scripts:
http://wd.mirmana.com/S90transmission
http://wd.mirmana.com/mvmovie
http://wd.mirmana.com/mkdvd
http://wd.mirmana.com/imdb

Last edited on 1240038762|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Reply  |  Options
Unfold Updated trans_watchdog by fraterfrater, 1238518171|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
khantprkhantpr 1241387278|%e %b %Y, %H:%M %Z|agohover

Does this work with tranmission 1.52-2? I am still running 1.42-1. Has anyone seen issues with 1.52 and can give me reasons on why I should not upgrade?

Reply  |  Options
Unfold Re: Updated trans_watchdog by khantprkhantpr, 1241387278|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1241389503|%e %b %Y, %H:%M %Z|agohover

It should work with all versions….
Please let me know if you experience any troubles…..

Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1241389503|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1240021091|%e %b %Y, %H:%M %Z|agohover

In case you miss it

[http://mybookworld.wikidot.com/forum/t-86827/automatically-start-stop-transmission#post-452113]

also, I don't know where to find the log that allows you to see the output from trans_watchdog.

Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1240021091|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
blackjancsiblackjancsi 1243774249|%e %b %Y, %H:%M %Z|agohover

try

nano /var/log/messages (will be on the bottom)
or less /var/log/messages

Reply  |  Options
Unfold Re: Updated trans_watchdog by blackjancsiblackjancsi, 1243774249|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1243780793|%e %b %Y, %H:%M %Z|agohover

Hello frater,

I have the new, white light version of the WD NAS. Does your trans_watchdog work on it?
Thanks in advance.

anpe008

Reply  |  Options
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1243780793|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1243781609|%e %b %Y, %H:%M %Z|agohover

It's written in bash script and it even works on other hardware…
But bash scripting is very sensitive to its environment because it often uses the output of programs as parameters.

Just try it and let me know if something is not running as it should….

I'm in the market for a white light myself.
Can you notice it's faster than a bluering?
Do you know of any alternatives?

Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1243781609|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1243857999|%e %b %Y, %H:%M %Z|agohover

ok, i will give it a try and report back here…

regarding the speed of the new white one:
I did not have the older, blue version, but I have read a lot review and forum about it
before i made my purchase. Each of these reviews said that the new, white version is a BIG improve over the older blue one.
this was the reason to go for the white WD version…

Some of them:
http://www.trustedreviews.com/networking/review/2009/02/18/Western-Digital-My-Book-World-Edition/p1
http://www.smallnetbuilder.com/content/view/30764/75/
http://www.smallnetbuilder.com/content/view/30764/75/1/2/ - Perf test
http://www.geek.com/articles/chips/review-western-digital-my-book-world-edition-1tb-nas-20090218/
http://www.crunchgear.com/2009/04/10/review-1tb-western-digital-my-book-world-edition-nas/
http://www.notebookreview.com/default.asp?newsID=4908

hope it helps

Just one question:
How can I easiest test my white WD perf speed using NFS and CIFS?
I want to test their speed independently…

thanks in advance

anpe008

Reply  |  Options
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1243857999|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244047093|%e %b %Y, %H:%M %Z|agohover

OK. I new at linux so I tried to follow your advice.
Please find my steps bellow:

I have installed these from OPTWARE:

  1. coreutils
  2. findutils
  3. procps
  4. util-linux-ng

I put the watch_dog to: "Public\WWW\Welcome\Transmission\trans_watchdog_ok"
added the right to it: chmod +x trans_watchdog_ok
and put it to 1-min cronjob: "01 * * * * /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok"
in "/opt/var/cron/crontabs", using "nano root" command

Changed the variables:
SOURCE=/shares/Public/WWW/Watch-dir
WORK=/shares/Public/WWW/TR-Downloads
TARGET=/shares/Public/WWW/Downloaded
MAILTO=moc.liamg|XXX#moc.liamg|XXX
MAILFROM=moc.liamg|XXX#moc.liamg|XXX
MAILSERVER="smtp.gmail.com"

Questions:
1) Do I have to change anything else in the trans_watchdog_ok?
2) TRANSSTOP=/opt/etc/init.d/K10transmission is missing —-> I have K90transmission. Should I just rename K10transmission to K90transmission?
3) Where can I find the error log?
4) When I wanted to run the "/shares/Public/WWW/Welcome/Transmission # trans_watchdog_ok", I received this: "-sh: trans_watchdog_ok: not found"
How can I run it from the telnet command line if i want to test it alone?

Thanks in advance.

anpe008

Reply  |  Options
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244047093|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244048462|%e %b %Y, %H:%M %Z|agohover

Question 1:
You don't have to change the variables in the script anymore.
After running it for the fist time you will have a config-file called /opt/etc/trans_watchdog_ok.conf

You can change the variables there….
This also means you can just overwrite trans_watchog with a newer one you download from my site.
Why did you change its name, btw?

Question 2:
You should create a symbolic link called /opt/etc/init.d/K10transmission

cd /opt/etc/init.d
ln -s S90transmission K10transmission

Question 3:
A log is made in /var/log/messages

Question 4:
Yes, new to Linux…. A common mistake. Unlike Windows, a command will not start just because you are in its directory. It must be in its path or you should provide the full path. In your case you should give the command

./trans_watchdog_ok
Last edited on 1244048741|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1244048462|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244049762|%e %b %Y, %H:%M %Z|agohover

Thank a lot for the really quick reply! I really appreciate it…

Q1: I found the .config file but it is empty. Is it ok?
Q2: I did it.
Q3: OK. Now, I can check it.
Q4: I run it and received the following error:

quoted text /shares/Public/WWW/Welcome/Transmission # ./trans_watchdog_ok
egrep: invalid option — o
BusyBox v1.1.1 (2008.11.20-08:20+0000) multi-call binary

Do I have ti install something or the error is in the script?

Q5: :) How can I restart cron? I do not have any /etc/init.d/crond.sh so can not run

/etc/init.d/crond.sh stop
/etc/init.d/crond.sh start

thanks in advance

Last edited on 1244052609|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244049762|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244053143|%e %b %Y, %H:%M %Z|agohover

Q1: I found the .config file but it is empty. Is it ok?

No, that's not OK

Q4: I run it and received the following error:

Are you running this on a worldbook? Do you have busybox installed from optware?
Run the command:

which egrep

You can probably fix it by installing "grep" in optware
ipkg install grep
Last edited on 1244053304|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Unfold Re: Updated trans_watchdog by fraterfrater, 1244053143|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244054529|%e %b %Y, %H:%M %Z|agohover

Q4:

Installing grep (2.5.3-1) to root…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable/grep_2.5.3-1_arm.ipk
Installing pcre (7.9-1) to root…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable/pcre_7.9-1_arm.ipk
Configuring grep
update-alternatives: Linking //opt/bin/grep to /opt/bin/grep-grep
update-alternatives: Linking //opt/bin/egrep to /opt/bin/grep-egrep
update-alternatives: Linking //opt/bin/fgrep to /opt/bin/grep-fgrep
Configuring pcre
Successfully terminated.

After run ./trans_watchdog_ok in telnet in the wordlbook i still have the same problem…

In the optware list I have three busybox option:

busybox - 1.10.3-1 - A userland replacement for embedded systems.
busybox-base - 1.10.3-1 - A userland replacement for embedded systems.
busybox-links - 1.10.3-1 - A userland replacement for embedded systems.

Which busybox should i install?

Last edited on 1244054729|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244054529|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244054984|%e %b %Y, %H:%M %Z|agohover
grep SCRIPTVER /usr/bin/trans_watchdog
SCRIPTVER="Wed Jun  3 11:22:18 CEST 2009"
grep -o SCRIPTVER /usr/bin/trans_watchdog
SCRIPTVER

or in your case….
grep SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok

If yours is older, redownload it and also delete /opt/etc/trans_watchdog_ok.conf

BTW…
What happens if you just enter the command "grep -o" from the prompt

Last edited on 1244055137|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Unfold Re: Updated trans_watchdog by fraterfrater, 1244054984|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244055763|%e %b %Y, %H:%M %Z|agohover

1) after executing your command, i have the same grep:

grep SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok
SCRIPTVER="Wed Jun 3 11:22:18 CEST 2009"

2) /opt/etc/trans_watchdog_ok.conf is deleted, should i delete the "trans_watchdog_ok.conf.exclude" as well?

3) after "grep -o":

grep -o
grep: invalid option — o
BusyBox v1.1.1 (2008.11.20-08:20+0000) multi-call binary

Usage: grep [-ihHnqvsEABC] PATTERN [FILEs…]

grep -o SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok
grep: invalid option — o
BusyBox v1.1.1 (2008.11.20-08:20+0000) multi-call binary

Usage: grep [-ihHnqvsEABC] PATTERN [FILEs…]

Last edited on 1244055937|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244055763|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244097461|%e %b %Y, %H:%M %Z|agohover

Which machine do you have?
I think it's a Worldbook White light…
Can other users of a White light confirm that "grep -o" is not working…..

BTW….
If you want to test your optware's grep, you should use the command

# /bin/grep -o SCRIPTVER /usr/bin/trans_watchdog
SCRIPTVER
[root@mybook ~]# /opt/bin/grep -o SCRIPTVER /usr/bin/trans_watchdog
SCRIPTVER

As you can see, both of the "greps" are working on my bluering and I'm really surprised it isn't working on yours….

"grep -o" is quite a normal option for grep….

Unfold Re: Updated trans_watchdog by fraterfrater, 1244097461|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244113684|%e %b %Y, %H:%M %Z|agohover

I have the white version.

You mentioned that the busybox is needed from OPTWARE to have the watchdog run properly.

I havent installed it yet. In the optware list I have three busybox option:

busybox - 1.10.3-1 - A userland replacement for embedded systems.
busybox-base - 1.10.3-1 - A userland replacement for embedded systems.
busybox-links - 1.10.3-1 - A userland replacement for embedded systems.

which one should I install? Maybe this is the problem, isn't it?

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244113684|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244127998|%e %b %Y, %H:%M %Z|agohover

which one should I install? Maybe this is the problem, isn't it?

no, no… don't think so

Let's first focus on "grep".
This should work…. check if /opt/bin/grep does the job.

Do you have the special feed for white light installed for your optware?

Please.. Other white light users…
Please report if "grep -o" is working on yours…
This is quite a normal option and even my superlightweight DD-WRT router supports it.
Only my dreambox (satellite receiver) doesn't support it and comes with a similar message….

If you want to replace busybox, just install the first one….
Beware that it will only execute it if it's first in the path.
In my script the $PATH is set that way.

Unfold Re: Updated trans_watchdog by fraterfrater, 1244127998|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244132716|%e %b %Y, %H:%M %Z|agohover

Do you have the original firmware or did you replace it with the one on this forum?

I think I can fix it for you….
But first you have to issue these 2 commands and post the results….
I will then tell you what to do.

ls -altr /bin/*grep*
ls -altr /opt/bin/*grep*

This is what happens when I do it (but I have a blue-ring):
# ls -altr /bin/*grep*
lrwxrwxrwx 1 root root     5 Jan  1  1970 /bin/zfgrep -> zgrep
lrwxrwxrwx 1 root root     5 Jan  1  1970 /bin/zegrep -> zgrep
-rwxr-xr-x 1 root root    33 Jan 18  2008 /bin/fgrep
-rwxr-xr-x 1 root root    33 Jan 18  2008 /bin/egrep
-rwxr-xr-x 1 root root  2940 Jan 18  2008 /bin/zgrep
-rwxr-xr-x 1 root root 71344 Jan 18  2008 /bin/grep
[root@mybook ~]# ls -altr /opt/bin/*grep*
-rwxr-xr-x 1 root root 154811 May 14 13:44 /opt/bin/msggrep
-rwxr-xr-x 1 root root 104332 May 14 14:02 /opt/bin/grep-grep
-rwxr-xr-x 1 root root  46916 May 14 14:02 /opt/bin/grep-fgrep
-rwxr-xr-x 1 root root 100220 May 14 14:02 /opt/bin/grep-egrep
-rwxr-xr-x 1 root root   1390 May 14 14:11 /opt/bin/zgrep
-rwxr-xr-x 1 root root  26968 May 14 16:32 /opt/bin/pcregrep
-rwxr-xr-x 1 root root  14800 May 14 17:00 /opt/bin/pgrep
-rwxr-xr-x 1 root root   1188 May 14 20:15 /opt/bin/zipgrep
lrwxrwxrwx 1 root root     18 Jun  3 20:20 /opt/bin/grep -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root     19 Jun  3 20:20 /opt/bin/egrep -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root     19 Jun  3 20:20 /opt/bin/fgrep -> /opt/bin/grep-fgrep
Unfold Re: Updated trans_watchdog by fraterfrater, 1244132716|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244137422|%e %b %Y, %H:%M %Z|agohover

1) Executing the script:

/bin/grep -o SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok
/bin/grep: invalid option — o
BusyBox v1.1.1 (2008.11.20-08:20+0000) multi-call binary

Usage: grep [-ihHnqvsEABC] PATTERN [FILEs…]

2) After running the other one:

  1. /opt/bin/grep -o SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok

SCRIPTVER

3)

  1. ls -altr /bin/*grep*

lrwxrwxrwx 1 root root 7 Jan 1 1970 /bin/grep -> busybox
lrwxrwxrwx 1 root root 7 Jan 1 1970 /bin/egrep -> busybox
lrwxrwxrwx 1 root root 7 Jan 1 1970 /bin/fgrep -> busybox

  1. ls -altr /opt/bin/*grep*

-rwxr-xr-x 1 root root 100396 Mar 26 07:17 /opt/bin/grep-grep
-rwxr-xr-x 1 root root 43292 Mar 26 07:17 /opt/bin/grep-fgrep
-rwxr-xr-x 1 root root 96284 Mar 26 07:17 /opt/bin/grep-egrep
-rwxr-xr-x 1 root root 23744 Apr 13 18:55 /opt/bin/pcregrep
-rwxr-xr-x 1 root root 11364 May 12 14:33 /opt/bin/pgrep
lrwxrwxrwx 1 root root 18 Jun 3 20:36 /opt/bin/grep -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 3 20:36 /opt/bin/egrep -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 3 20:36 /opt/bin/fgrep -> /opt/bin/grep-fgrep

4) I upgraded the original firmware and then I applied that featurepack: [http://mybookworld.wikidot.com/forum/t-149988/featurepacks-manager-for-the-whitelight-available]

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244137422|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244139169|%e %b %Y, %H:%M %Z|agohover

Mmmm….
I think they have done something strange with that featurepack or the white-light doesn't have its own grep…
I'm still considering to buy a white-light….

Let's fix your box…
Just copy/paste the following code and you have at least fixed grep….

mv /bin/grep /bin/grep-busy
mv /bin/egrep /bin/egrep-busy
mv /bin/fgrep /bin/fgrep-busy

ln -s /opt/bin/grep-grep /bin/grep
ln -s /opt/bin/grep-egrep /bin/egrep
ln -s /opt/bin/grep-fgrep /bin/fgrep

/bin/grep -o SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok
Unfold Re: Updated trans_watchdog by fraterfrater, 1244139169|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244141550|%e %b %Y, %H:%M %Z|agohover

~ # mv /bin/grep /bin/grep-busy
~ # mv /bin/egrep /bin/egrep-busy
~ # mv /bin/fgrep /bin/fgrep-busy
~ # ln -s /opt/bin/grep-grep /bin/grep
~ # ln -s /opt/bin/grep-egrep /bin/egrep
~ # ln -s /opt/bin/grep-fgrep /bin/fgrep
~ # /bin/grep -o SCRIPTVER /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok
SCRIPTVER

~ # ls -altr /bin/*grep*
lrwxrwxrwx 1 root root 18 Jun 4 20:50 /bin/grep-busy -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 4 20:50 /bin/egrep-busy -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 4 20:50 /bin/fgrep-busy -> /opt/bin/grep-fgrep
lrwxrwxrwx 1 root root 18 Jun 4 20:51 /bin/grep -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 4 20:51 /bin/egrep -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 4 20:51 /bin/fgrep -> /opt/bin/grep-fgrep
~ # ls -altr /opt/bin/*grep*
-rwxr-xr-x 1 root root 100396 Mar 26 07:17 /opt/bin/grep-grep
-rwxr-xr-x 1 root root 43292 Mar 26 07:17 /opt/bin/grep-fgrep
-rwxr-xr-x 1 root root 96284 Mar 26 07:17 /opt/bin/grep-egrep
-rwxr-xr-x 1 root root 23744 Apr 13 18:55 /opt/bin/pcregrep
-rwxr-xr-x 1 root root 11364 May 12 14:33 /opt/bin/pgrep
lrwxrwxrwx 1 root root 18 Jun 3 20:36 /opt/bin/grep -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 3 20:36 /opt/bin/egrep -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 3 20:36 /opt/bin/fgrep -> /opt/bin/grep-fgrep

PS: Thanks for your help…

If you need something to test in the White version, just let me know.
I have only a 100Mbit router, and the speed is 10-11 MB/s if the laptop is directly connected to the router
i think it can handle more, this speed is the max on that 100mb…

Last edited on 1244141845|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244141550|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244143423|%e %b %Y, %H:%M %Z|agohover

I don't really understand:

lrwxrwxrwx 1 root root 18 Jun 4 20:50 /bin/grep-busy -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 4 20:50 /bin/egrep-busy -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 4 20:50 /bin/fgrep-busy -> /opt/bin/grep-fgrep

It was ment as a backup… You can delete these
cd /bin
rm grep-busy
rm egrep-busy
rm fgrep-busy

Does the script run fine now?
Unfold Re: Updated trans_watchdog by fraterfrater, 1244143423|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244144010|%e %b %Y, %H:%M %Z|agohover

/bin # ls -altr /bin/*grep*
lrwxrwxrwx 1 root root 18 Jun 4 20:51 /bin/grep -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 4 20:51 /bin/egrep -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 4 20:51 /bin/fgrep -> /opt/bin/grep-fgrep
/bin # ls -altr /opt/bin/*grep*
-rwxr-xr-x 1 root root 100396 Mar 26 07:17 /opt/bin/grep-grep
-rwxr-xr-x 1 root root 43292 Mar 26 07:17 /opt/bin/grep-fgrep
-rwxr-xr-x 1 root root 96284 Mar 26 07:17 /opt/bin/grep-egrep
-rwxr-xr-x 1 root root 23744 Apr 13 18:55 /opt/bin/pcregrep
-rwxr-xr-x 1 root root 11364 May 12 14:33 /opt/bin/pgrep
lrwxrwxrwx 1 root root 18 Jun 3 20:36 /opt/bin/grep -> /opt/bin/grep-grep
lrwxrwxrwx 1 root root 19 Jun 3 20:36 /opt/bin/egrep -> /opt/bin/grep-egrep
lrwxrwxrwx 1 root root 19 Jun 3 20:36 /opt/bin/fgrep -> /opt/bin/grep-fgrep

/shares/Public/WWW/Welcome/Transmission # ./trans_watchdog_ok
egrep: invalid option — o
BusyBox v1.1.1 (2008.11.20-08:20+0000) multi-call binary

No help available.

./trans_watchdog_ok: ./trans_watchdog_ok: 97: Syntax error: "(" unexpected

Last edited on 1244144140|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244144010|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244145265|%e %b %Y, %H:%M %Z|agohover

This is all very strange…..
Can't you install bash ( ipkg install bash )?
and change the first line of my script into:

#!/opt/bin/bash

There's no reason at all for the system to call busybox anymore when you issue the "egrep" command…..
It seems it has a mind of its own….

I suspect you have changed the script with a windows editor…
Can't you do:

cd /opt/sbin
wget http://wd.mirmana.com/trans_watchdog
chmod +x trans_watchdog
trans_watchdog

afterwards you can edit the config-file for your changed directory-structure….
vi /opt/etc/trans_watchdog.conf
Last edited on 1244146158|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Unfold Re: Updated trans_watchdog by fraterfrater, 1244145265|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244147009|%e %b %Y, %H:%M %Z|agohover

Installed bash:

  1. ipkg install bash

Installing bash (3.2.33-1) to root…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable/bash_3.2.33-1_arm.ipk
Installing readline (6.0-1) to root…
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable/readline_6.0-1_arm.ipk
Configuring bash
Configuring readline
Successfully terminated.

Run the watchdog:

  1. ./trans_watchdog_ok

Unknown HZ value! (94) Assume 100.
Unknown HZ value! (94) Assume 100.
SOURCE: /shares/Public/WWW/Watch-dir
WORK: /shares/Public/WWW/TR-Downloads
TARGET: /shares/Public/WWW/Downloaded
USER: root
SCRIPTNAME: ./trans_watchdog_ok
SAMBA USER: www-data
DATA USER: www-data
DATA GROUP: www-data
Schedule for 22:00 is 0
I will try to keep transmission running
Transmission is running
Transmission is NOT responding
Exiting because Transmission doesn't respond properly
Stopping Torrent client: transmission-daemon
Starting Torrent client: transmission-daemon

I use nano for editing…
Getting closer and closer….

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244147009|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244148724|%e %b %Y, %H:%M %Z|agohover

I used the 1-min cronjob to run the watchdog.
in the log i receive this:
Jun 4 22:42:01 MyBookWorld cron.info /opt/sbin/cron[8517]: (root) CMD (/shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok)
Jun 4 22:43:01 MyBookWorld cron.info /opt/sbin/cron[8572]: (root) CMD (/shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok)
Jun 4 22:44:01 MyBookWorld cron.info /opt/sbin/cron[8627]: (root) CMD (/shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok)
Jun 4 22:45:01 MyBookWorld cron.info /opt/sbin/cron[8682]: (root) CMD (/shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok)

is it ok that it runs in each minute?

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244148724|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244150109|%e %b %Y, %H:%M %Z|agohover

Yes, it should run each minute….

This error:

Unknown HZ value! (94) Assume 100.

Does it happen too if you just run?:

ps -efu root

or
ps -e

If "ps -e" doesn't give you an error and "ps -efu ${USER}" does… you can safely replace it….

It can also be related to "top"

It has something to do with "procps"… Did you install it?
Try to install/update procps and run "ldconfig"

Unfold Re: Updated trans_watchdog by fraterfrater, 1244150109|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244150756|%e %b %Y, %H:%M %Z|agohover

For both command i do not receive any error.
Both shows the processes…

procps - 3.2.8-1 is installed

~ # ipkg install procps
Package procps (3.2.8-1) installed in root is up to date.
Nothing to be done
Successfully terminated.

I tried to run ldconfig but i couldnt:

~ # ldconfig
-sh: ldconfig: not found
~ # ./ldconfig
-sh: ./ldconfig: not found

BTW, the /opt/etc/trans_watchdog.conf is still empty
should i put my config there?

SOURCE=/shares/Public/WWW/Watch-dir
WORK=/shares/Public/WWW/TR-Downloads
TARGET=/shares/Public/WWW/Downloaded
MAILTO=moc.liamg|XXX#moc.liamg|XXX
MAILFROM=moc.liamg|XXX#moc.liamg|XXX
MAILSERVER="smtp.gmail.com"

Last edited on 1244151078|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244150756|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244151631|%e %b %Y, %H:%M %Z|agohover

If I run the watchdog, i do not receive any message back.
Does it mean that it works now?

~ # /shares/Public/WWW/Welcome/Transmission/trans_watchdog_ok
~ #

/shares/Public/WWW/Welcome/Transmission # ./trans_watchdog_ok
/shares/Public/WWW/Welcome/Transmission #

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244151631|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244151798|%e %b %Y, %H:%M %Z|agohover

I just ordered a white-light which I will probably receive next monday.
I'm giving it up for a while….
Or this white-light is behaving strange or it has something to do with your system….

As I said…
It even runs on a DD-WRT router (Asus WL-500G Deluxe) with a USB-harddisk attached….
I have no idea why your system behaves this way….

Unfold Re: Updated trans_watchdog by fraterfrater, 1244151798|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244152199|%e %b %Y, %H:%M %Z|agohover

ok, let's see how it works for you…

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244152199|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244245388|%e %b %Y, %H:%M %Z|agohover

FYI, I have now data in /opt/etc/trans_watchdog_ok.conf…

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244245388|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1244315915|%e %b %Y, %H:%M %Z|agohover

I have found a error.log for the watchdog in /tmp/trans_watchdog_ok.error
it says: "Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User@"

maybe that was the problem

i have auth in transmission…

Last edited on 1244315945|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1244315915|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244626890|%e %b %Y, %H:%M %Z|agohover

I received this whitelight and although I like its increased performance the console is a bit retarded when it comes out of the box.

Unlike the bluering it doesn't have /bin/sh linked to /bin/bash but to busybox.
Even when you have installed optware and have /opt/bin as first in your path it still uses the busybox for commands that are hashed.
I wasn't aware of this, but I now have found a remedy.

I wrote a script to take care of a lot of issues with the whitelight and it's a breeze to install it

wget -O prep_whitelight http://wd.mirmana.com/prep_whitelight
sh prep_whitelight

After running this script you should be able to run my watchdog and other advanced bash-scripts.

It will also take care of a permission of the directory /root which prevents it from using a private/public key and it will create a directory structure to be used for cron.

Last edited on 1244627057|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Unfold Re: Updated trans_watchdog by fraterfrater, 1244626890|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244627148|%e %b %Y, %H:%M %Z|agohover

For those who want to look at the script without downloading:

Edit: I added an extra check when optware installation fails and the removal of /opt/etc/ipkg/armel-feed.conf if it still goes wrong…
Otherwise this script doesn't try to install optware if it partly fails…..

Edited again I wanted a bash that doesn't depend on optware in /bin

#!/bin/sh
PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

if ! cat /proc/cpuinfo | grep -q ARM926EJ ; then
  echo "This is not an ARM device"
  exit 1
fi
if [ `cat /proc/meminfo | grep MemTotal | awk '{print $2}'` -lt 100000 ] ; then
  echo "This is probably not a WD Whitelight Edition ( a Bluering?? )"
  exit 1
fi

if [ ! "$USER" = root ]; then
  echo "You're not root, you're ${USER}..  exiting"
  exit 1
fi

cd ~

if [ -e "/opt/etc/ipkg/armel-feed.conf" ] ; then
  echo "You already installed optware, good show!"
else
  echo -e "Optware is not installed... Let's install it\n"
  feed=http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable
  ipk_name=$(wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}')
  wget $feed/$ipk_name
  if [ $? -ne 0 ] ; then
    echo "I wasn't able to properly download the optware feed"
    echo "I will exit this script!!"
    exit 1
  else
    tar -xOvzf $ipk_name ./data.tar.gz | tar -C / -xzvf -
    mkdir -p /opt/etc/ipkg
    echo "src armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q1armel/cross/unstable" > /opt/etc/ipkg/armel-feed.conf
    wget -O sort_dirname.tar.gz http://mybookworld.wikidot.com/local--files/optware/sort_dirname.tar.gz
    if [ $? -ne 0 ] ; then
      echo -e "Failed to download sort_dirname.tar.gz from mybookworld.wikidot.com.... trying alternative"
      wget -O sort_dirname.tar.gz http://wd.mirmana.com/sort_dirname.tar.gz
      if [ $? -ne 0 ] ; then
        echo "I wasn't able to properly download the optware feed"
        echo "I will exit this script!!"
        rm /opt/etc/ipkg/armel-feed.conf
        exit 1
      else
        tar xvfz sort_dirname.tar.gz -C /
      fi
    else
      tar xvfz sort_dirname.tar.gz -C /
    fi
  fi
fi

mkdir -p /opt/etc/init.d 2>/dev/null
mkdir /usr/local/sbin 2>/dev/null

if grep -q opt /root/.bashrc ; then
  echo -e "You already have optware in your \$PATH.. in /root/.bash_profile    Good show!"
else
  mkdir /root/.org 2>/dev/null
  cp -p /root/.* /root/.org/
  sed -i -e "s/bin\/X11/local\/sbin/" /root/.bashrc
  sed -i -e "s/bin\/X11/local\/sbin/" /root/.bash_profile

  sed -i -e "s/^export PATH=/echo \$PATH | grep -q local || export PATH=/" /root/.bashrc
  sed -i -e "s/^\/bin:/\/opt\/bin:\/opt\/sbin:\/bin:/" /root/.bashrc
  sed -i -e "s/^\/bin:/\/opt\/bin:\/opt\/sbin:\/bin:/" /root/.bash_profile
fi

echo -e "Updating ipkg\n"
ipkg update
if [ $? -ne 0 ] ; then
  echo -e "I wasn't able update optware\nI don't dare to go on...\n\n"
  exit 1
fi

if ! ipkg list_installed | grep -q bash ; then
  ipkg install bash
  if [ $? -ne 0 ] ; then
    echo -e "I wasn't able to install bash in optware\nI therefore don't dare to go on...\n\n"
    exit 1
  fi
fi

wget -O bash.tar.gz http://wd.mirmana.com/bash-3.2.33+readline-6.0+gettext-0.14.5.tar.gz
tar xvfz bash.tar.gz -C /
if [ $? -ne 0 ] ; then
  echo "Failed to extract /bin/bash....."
  exit 1
fi

echo "exit 5" | /bin/bash
if [ $? -ne 5 ] ; then
  echo -e "Although bash is installed it somehow isn't working properly"
  echo -e "I'm stopping this script to prevent damage to your precious box!!"
  exit 1
fi

if [ -x /bin/bash ]; then
  if [ -h /bin/sh ] ; then
    rm -f /bin/sh
    rm -f /bin/shh
    ln -s busybox /bin/shh
    ln -s bash /bin/sh
  fi
else
  echo -e "WARNING: There's no executable /bin/bash\n"
fi

ipkg install colordiff
ipkg install coreutils
ipkg install diffutils
ipkg install findutils
ipkg install psutils
ipkg install inetutils
ipkg install net-tools
ipkg install grep
ipkg install htop
ipkg install ncdu
ipkg install procps
ipkg install sed
ipkg install vim
ipkg install wget
ipkg install sed
ipkg install unzip
ipkg install unrar

# patch for a missing library
# ln -s libreadline.so.6 /opt/lib/libreadline.so.5 2>/dev/null

if /opt/bin/stat --format=%A /root | cut -b5- | grep -q w ; then
  echo "You have write permissions on the /root directory for other users than root"
  echo "This is a problem when you want to use the /root/.ssh directory"
  echo "I'm removing these write permissions for the group root and others"
  echo "I leave the permissions for the user root untouched"
  chmod og-w /root
else
  echo -e "\n\n/root only has write permissions for the 'root'  this is good!\n"
fi

[ -d /root/.ssh ] || mkdir /root/.ssh

if [ -e /etc/init.d/S90optware ] ; then
  echo -e "/etc/init.d/S90optware already exists, this is good\n"
  if [ ! -x /etc/init.d/S90optware ] ; then
    echo -e "Warning: The file /etc/init.d/S90optware is not executable, maybe you did this on purpose?"
    echo -e "         Optware packages will not be started automatically\n"
  fi
else
  echo "#!/bin/sh" >/etc/init.d/S90optware
  echo "if [ -d /opt/etc/init.d ]; then" >>/etc/init.d/S90optware
  echo -e "\tfor f in /opt/etc/init.d/S* ; do" >>/etc/init.d/S90optware
  echo -e "\t\t[ -x \$f ] && \$f start" >>/etc/init.d/S90optware
  echo -e "\tdone" >>/etc/init.d/S90optware
  echo "fi" >>/etc/init.d/S90optware
  chmod +x /etc/init.d/S90optware
fi

# Install cron and a directory structure for scheduling

if ! ipkg list_installed | grep -q cron ; then
  ipkg install cron
fi

if ! ipkg list_installed | grep -q cron ; then
  echo -e "Cron is not installed, which is strange as I just installed it\nI'm not continuing this script\n"
  exit 1
fi

mkdir /etc/cron.min 2>/dev/null
mkdir /etc/cron.5mins 2>/dev/null
mkdir /etc/cron.15mins 2>/dev/null
mkdir /etc/cron.30mins 2>/dev/null
mkdir /etc/cron.hourly 2>/dev/null
mkdir /etc/cron.daily 2>/dev/null
mkdir /etc/cron.weekly 2>/dev/null
mkdir /etc/cron.montly 2>/dev/null

[ -e /opt/etc/crontab.org ] || cp -p /opt/etc/crontab /opt/etc/crontab.org

if grep -q run-parts /opt/etc/crontab ; then
  echo -e "I probably modified /opt/etc/crontab already\nCheck this file if you're not sure\n"
else
  echo -e "I will now modify /opt/etc/crontab...\n"
  # sed -i -e "s/bin\/sh/bin\/bash/" /opt/etc/crontab
  sed -i -e "s/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/opt\/sbin:\/opt\/bin/opt\/bin:\/opt\/sbin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/local\/bin/" /opt/etc/crontab

  echo -e "* * * * *\t\troot run-parts /etc/cron.min" >>/opt/etc/crontab
  echo -e "*/5 * * * *\t\troot run-parts /etc/cron.5mins" >>/opt/etc/crontab
  echo -e "1,16,31,46 * * * *\troot run-parts /etc/cron.15mins" >>/opt/etc/crontab
  echo -e "3,33 * * * *\t\troot run-parts /etc/cron.30mins" >>/opt/etc/crontab
  echo -e "1 * * * *\t\troot run-parts /etc/cron.hourly" >>/opt/etc/crontab
  echo -e "2 4 * * *\t\troot run-parts /etc/cron.daily" >>/opt/etc/crontab
  echo -e "22 4 * * 0\t\troot run-parts /etc/cron.weekly" >>/opt/etc/crontab
  echo -e "42 4 1 * *\t\troot run-parts /etc/cron.monthly" >>/opt/etc/crontab
fi

# Write a 15 minute cronjob to clean /var/log/messages from useless cron messages
echo '#!/bin/sh' >/etc/cron.15mins/zmsgcln
echo 'grep -v ".*cron\.info.*run-parts.*$" /var/log/messages >/var/log/.messages' >>/etc/cron.15mins/zmsgcln
echo 'mv /var/log/.messages /var/log/messages' >>/etc/cron.15mins/zmsgcln
chmod +x /etc/cron.15mins/zmsgcln

# Start cron
/opt/etc/init.d/S10cron

echo -e "Script finished!!\nYou can now fully use optware if you login again...\n"
Last edited on 1244649519|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Unfold Re: Updated trans_watchdog by fraterfrater, 1244627148|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
alllexxalllexx 1244628129|%e %b %Y, %H:%M %Z|agohover
# patch for a missing library
ln -s libreadline.so.6 /opt/lib/libreadline.so.5 2>/dev/null

You shouldn't need this after ‘ipkg update`,`ipkg upgrade` unless there’s some optware bug. Maybe, Brian Zhou forgot to bump ipk version in some package. Can you please tell what package errors out?
Unfold Re: Updated trans_watchdog by alllexxalllexx, 1244628129|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244633687|%e %b %Y, %H:%M %Z|agohover

You shouldn't need this after ‘ipkg update`,`ipkg upgrade`

I only have this worldbook 2 days, so it's obviously an issue now.

Optware's ftp-client doesn't work without it…

[root@mybook2 ~]# rm /opt/lib/libreadline.so.5
[root@mybook2 ~]# ftp
ftp: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory
[root@mybook2 ~]# ln -s libreadline.so.6 /opt/lib/libreadline.so.5
[root@mybook2 ~]# ftp
ftp> bye
[root@mybook2 ~]#

It's probably this package:

ipkg list_installed | grep readline
readline - 6.0-1 - The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are
Unfold Re: Updated trans_watchdog by fraterfrater, 1244633687|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
alllexxalllexx 1244634022|%e %b %Y, %H:%M %Z|agohover

Ok, it's an optware bug. What package this 'ftp' binary comes from? That's the real culprit as it's linked against the previous readline version.

Last edited on 1244634051|%e %b %Y, %H:%M %Z|agohover By alllexx + Show more
Unfold Re: Updated trans_watchdog by alllexxalllexx, 1244634022|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244635113|%e %b %Y, %H:%M %Z|agohover

lrwxrwxrwx 1 root root 22 Jun 9 08:39 ftp -> /opt/bin/inetutils-ftp*

inetutils - 1.5-5 - A set of common daemons and clients found on commercial UNIX systems.

Unfold Re: Updated trans_watchdog by fraterfrater, 1244635113|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
alllexxalllexx 1244637778|%e %b %Y, %H:%M %Z|agohover

Fixed and commited, but it will take some time until it's built and available on the feed.
If you notice some other optware issues, please let Brian Zhou know and it will be fixed.

Unfold Re: Updated trans_watchdog by alllexxalllexx, 1244637778|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1244638367|%e %b %Y, %H:%M %Z|agohover

I've sent you a private message….

Unfold Re: Updated trans_watchdog by fraterfrater, 1244638367|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1245404379|%e %b %Y, %H:%M %Z|agohover

So after successfully install your prep_whitelight, i gave a try and added yesterday the trans_watchdog
(renamed from trans_watchdog_ok) as a 1-min cronjob.I let it run the whole night and checked the result this morning.

- in the /var/log/messages the trans_watchdog runs in each minute
- My vi /opt/etc/trans_watchdog.exude is empty.
- My vi /opt/etc/trans_watchdog.conf:

AUTO_REMOVE_FROM_LIST=1
AUTO_REMOVE_SEEDLINK=1
AUTO_UNRAR=1
CPULEVEL=5
DATAGROUP=www-data
DEBUG=1
FULL_THROTTLE_DOWN=0
FULL_THROTTLE_UP=30
INTERVAL=5
KEEPRAR=0
KEEP_TRANSMISSION_RUNNING=1
MAILERSERVICE=sendEmail
MAILFROM=moc.liamg|xxxx#moc.liamg|xxxx
MAILSERVER=smtp.gmail.com
MAILTO=moc.liamg|xxx#moc.liamg|xxx
MAX_RATIO=1.0
MAX_SEEDHOURS=48
MAX_SIMULTANEOUS=5
MIN_SEEDHOURS=1
SCHEDULE_THROTTLE_DOWN=2000
SCHEDULE_THROTTLE_UP=20
SCHEDULE_WEEKEND=([0]="0" [1]="0" [2]="1" [3]="1" [4]="1" [5]="1" [6]="1" [7]="$
SCHEDULE_WORKDAY=([0]="1" [1]="1" [2]="1" [3]="1" [4]="1" [5]="1" [6]="1" [7]="$
SOURCE=/shares/Public/WWW/Qtorrent/Watchtorrent/
SUPERSOCIAL=1
TARGET=/shares/Public/WWW/Qtorrent/Downloaded
THROTTLE_DONTKILL=1
THROTTLE_DOWN=100
THROTTLE_UP=1
TRANSDAEMON=/opt/bin/transmission-daemon
TRANSOPTS=' -m'
TRANSREMOTE=/opt/bin/transmission-remote
TRANSSTART=/opt/etc/init.d/S90transmission
TRANSSTOP=/opt/etc/init.d/K10transmission
WORK=/shares/Public/WWW/Qtorrent/Downloading/
WORKDAY=([0]="0" [1]="1" [2]="1" [3]="1" [4]="1" [5]="1" [6]="0")

If I run the trans_watchdog:

[root@MyBookWorld Transmission]# ./trans_watchdog
[root@MyBookWorld Transmission]#

Then I started the Transmission (1.72) and waited. I experienced the same problem that I had with the 1.61 when I took
trans_watchdog in the crontab. For some reason the Transmission starts and after 30sec-1min couple of minutes it just restarts and after
I lose the connection with my Transmisison using the Transmission-Remote all the time. Couple of sec later I am able to connect again
but it start to check the torrent and stick at some %. Than lose connection… Then stucks at rechecking…
If i do not run the trans_watchdog it runs without any problem.

I think we have the problem still at the variables configuration but not sure…

My info:
-trans_watchdog location: "Public\WWW\Welcome\Transmission\trans_watchdog",
-cronjob line: "*/1 * * * * /shares/Public/WWW/Welcome/Transmission/trans_watchdog" in "/opt/var/cron/crontabs/root",

My variables:
SOURCE=/shares/Public/WWW/Qtorrent/Watchtorrent
WORK=/shares/Public/WWW/Qtorrent/Downloading
TARGET=/shares/Public/WWW/Qtorrent/Downloaded
MAILTO=moc.liamg|XXX#moc.liamg|XXX
MAILFROM=moc.liamg|XXX#moc.liamg|XXX
MAILSERVER="smtp.gmail.com"

Just to make it sure the trans_watchdog does the following:
1) creates the trans_watchdog.config and trans_watchdog.exlude files with all the necessary variables info
2) looks for and adds new torrents in the $SOURCE directory
3) depending on the presettings (occupancy of samba, workday/weekend schedules , cpulevel) it tracks/adjusts the downloads in $WORK directory
4) If a downloaded torrent contains multirar files it unrars them and delete the rars files.
5) moves the downloaded files to $TARGETdirectory and send email from the successful download
6) Removing obsolete symbolic links
+ stops transmission every 3 hours when it isn't handling anything

General questions about the trans_watchdog:
0) Does the script try to start transmission if it is not running?

1) Do I have to change the "www-data" to something?:

SMB_USER=www-data
DATAUSER=www-data
DATAGROUP=www-data

2) Changing the workday/weekend schedule:

If I want to change the schedule I have to change only the 0 to 1 or 1 to 0 in the variables, rights?

What do you need from me to proceed?

Last edited on 1245432595|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1245404379|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1245436569|%e %b %Y, %H:%M %Z|agohover

Ok. I lose my connection exactly after each 5 mins. Do you have something as a 5min cronjob?
I could find anyting in cron.5mins…

Unfold Re: Updated trans_watchdog by anpe008anpe008, 1245436569|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
anpe008anpe008 1245658394|%e %b %Y, %H:%M %Z|agohover

Yesterday I played with the trans_watchdog.

Two things:
1) senEmail did not work.
1A)
What do you have in the config the "MAIL_TO" or "MAILTO"?
I have "MAIL_TO" but the mailfrom is "MAILFROM". Maybe this is the problem.

1A) Do you have an example to run sendEmail from command prompt and try if it works alone?

2) I fihured out the root of the crashes that happend in each 5-min. It was the following line:

"rpc-authentication-required": false,

If it is true, then it crashes all the time after 5mins.

Last edited on 1245658517|%e %b %Y, %H:%M %Z|agohover By anpe008 + Show more
Reply  |  Options
Unfold Re: Updated trans_watchdog by anpe008anpe008, 1245658394|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
blackjancsiblackjancsi 1243853682|%e %b %Y, %H:%M %Z|agohover

Hey frater,

I have been messing around with transmission 1.61 lately, but it seems that some features don't quite work - neither the watch folder, nor the scheduling (though it is parametered correctly). The seeding ratio, seems to be working, however, I would prefer the completed file to be moved out of the directory, nevertheless. I have been experimenting with M. Kyykhinen's torrent_helper script before, but that did not quite work, either (no idea, why exactly, on one hand, it tended to crash the daemon, on the other, the scheduler did not work).
I was interested in having a scheduler, something that stops and moves the torrents out of the download directory once they reach a certain seeding ratio, a watch folder (I added a little directory for the torrents added in the past as well, so once it starts dowloading a torrent, instead of deleting the file, it moves it over to another directory). As I wasted a lot of time already with this, I was going to ask you how long this was going to take me (need to learn how to use cron as well, though I can do that on my own, I just don't know how long that'll be), and whether your script works OK with version 1.61.

Thanks and good job,
blackjancsi

Reply  |  Options
Unfold Re: Updated trans_watchdog by blackjancsiblackjancsi, 1243853682|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1243858985|%e %b %Y, %H:%M %Z|agohover

AFAIK everything is working fine with the latest version and if not I will investigate it and change its code.
Because my worldbook is quite full I'm not downloading that much anymore….

I did see a torrent just now that was paused….
Maybe the latest transmission doesn't like it when the file is moved and a symbolic link is placed instead.
Not a problem really as I can add code for that…..

Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1243858985|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254293721|%e %b %Y, %H:%M %Z|agohover

Seems something has changed with the newest version of transmission (Transmission 1.75 (9117)) trans_watchdog refuses to add any more torrents, saying the limit (5) has already been reached, but, there are none downloading….

I tried before updating to the latest trans_watchdog (everything was working fine until I updated Transmission) and, also, after updating to the latest version of the script…

Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254293721|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254297275|%e %b %Y, %H:%M %Z|agohover

I figured out why, they added Idle as one of the possible states for torrents. so, line 193 needs to be changed to

DOWNLOADING=`${TW_TRANSREMOTE} -l 2>${ERROROUTPUT} | grep -vi "Idle" | grep -vi "Done" | grep -v "ETA " | egrep -v "^Sum:" | wc -l`

actually, to be more accurate, it should be changed to

DOWNLOADING=`${TW_TRANSREMOTE} -l 2>${ERROROUTPUT} | grep -vi "Seeding" | grep -vi "Idle" | grep -vi "Done" | grep -v "ETA " | egrep -v "^Sum:" | wc -l`

but, I think we had this conversation before :)

Last edited on 1254297806|%e %b %Y, %H:%M %Z|agohover By IAmParadox + Show more
Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254297275|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1254340792|%e %b %Y, %H:%M %Z|agohover

I changed it….

Last edited on 1254341258|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1254340792|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254334452|%e %b %Y, %H:%M %Z|agohover

New problem, my torrents don't seem to be getting moved to the proper directory when they finish downloading… or any directory at all, as far as I can tell…. The actual file is still in the Download directory instead of a link.

Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254334452|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1254341643|%e %b %Y, %H:%M %Z|agohover

Do you have more info? You pretty much know how it's working. can you debug some more?

Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1254341643|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254460574|%e %b %Y, %H:%M %Z|agohover

Well, I have this in the messages log:

Sep 30 14:20:24 MediaServe user.notice transmission: Pausing torrent #31 (*****) so it can be moved
Sep 30 14:20:25 MediaServe user.notice transmission: Created a symbolic link in /shares/internal/JUNK/Torrent_Temp to: /shares/internal/NEW/*****
Sep 30 14:20:25 MediaServe user.notice transmission: Sending eMail using sendEmail
Sep 30 14:20:25 MediaServe user.notice transmission: The perl script "sendEmail" can not be found, you need to install it
Sep 30 14:20:25 MediaServe user.notice transmission: Unpausing torrent #31 (*****)

So, it is trying to send me an email about the problem, instead of just outputting it to the log…..

It's also not writing the log files for the files…..

I'll see if I can add some log output there and see what it says.

Some of the torrents don't even show where an attempt was made at all to pause them….

Edit: I know something that needs to be added, a command line switch to bypass the part that only runs the whole thing every so many minutes….

Last edited on 1254463587|%e %b %Y, %H:%M %Z|agohover By IAmParadox + Show more
Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254460574|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1254466141|%e %b %Y, %H:%M %Z|agohover

Edit: I know something that needs to be added, a command line switch to bypass the part that only runs the whole thing every so many minutes….

Not really…
The script should be run every minute so it doesn't take too long before a torrent is added from the watchfolder. To keep the Worldbook from stressing it will abort the script after monitoring the watchfolder and will continue only every 5 minutes….

It seems you have not installed "SendEmail"
It's a perl-script which should be in your PATH to work. Nothing trivial though. It just informs you a torrent is finished.

The log seems to be normal. Do you mean this torrent (#31) didn't move to /shares/internal/NEW ?

Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1254466141|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254470698|%e %b %Y, %H:%M %Z|agohover

The log seems to be normal. Do you mean this torrent (#31) didn't move to /shares/internal/NEW ?

That's exactly what I mean, along with every other torrent I have downloaded since updating.

and, what i meant was, a command line switch that would allow you to run the whole script manually no matter how long it's been (which I already went and added to mine) I was getting tired of waiting for just the right moment every 5 minutes, so I could see the entire output (most of that never goes to the log)

Edit: I wonder if it has anything to do with this…..
cat "${REMOUTPUT}" | grep "100%" | grep "Done " | cut -b${namepos}- >$FTEMP
They don't seem to be using Done anymore, it's now Idle… I guess, and Seeding, etc. I decided to check the /tmp/trans_watchdog.output file, and that's when I noticed none of them say Done… I'm not even sure how the one I posted as an example ever even got that far…

Edit2: I changed the Line to
cat "${REMOUTPUT}" | grep "100%" | grep "Unknown " | cut -b${namepos}- >$FTEMP
using Unknown so it wouldn't stop files that are still seeding, and, it seems to have gone back to working.
using unknown may not be the best way to keep it from interrupting files that are seeding at that moment (since some could still say unknown) but, getting rid of Done fixed the problem, since newer versions of transmission don't seem to use Done anymore.

Adding Grep -v "Seeding " could be a good way to stop only torrents that aren't currently seeding…. just a thought :)

Last edited on 1254472959|%e %b %Y, %H:%M %Z|agohover By IAmParadox + Show more
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254470698|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1254481977|%e %b %Y, %H:%M %Z|agohover

They don't seem to be using Done anymore, it's now Idle…

I'm running 1.75 and "Done" is still in that line if a torrent is fully downloaded….

# transmission-remote -l
ID     Done       Have  ETA           Up    Down  Ratio  Status       Name
   1   100%     3.5 GB  Done         0.0     0.0   0.71  Idle         *************** ****
   2   100%     4.3 GB  Done       100.0     0.0   1.35  Seeding      ********** **** **** ***
Sum:            7.8 GB             100.0     0.0

It checks the full line for that word….
I'm not denying there's something wrong with the script although I'm not experiencing any problems.
It's still working at my friend's system…. I'm not downloading at the moment……
Last edited on 1254501868|%e %b %Y, %H:%M %Z|agohover By frater + Show more
Unfold Re: Updated trans_watchdog by fraterfrater, 1254481977|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254625275|%e %b %Y, %H:%M %Z|agohover

Transmission 1.75 (9117)

ID     Done       Have  ETA           Up    Down  Ratio  Status       Name
   1   100%     5.0 GB  Unknown      0.0     0.0   0.10  Idle         ***************
   2   100%   232.1 MB  Unknown      0.0     0.0   0.85  Idle         *********************
   3   100%   350.4 MB  1 days       2.0     0.0   0.80  Seeding      *********************
   4   100%   350.0 MB  Unknown      0.0     0.0   0.60  Idle         ********************
   5   100%   175.0 MB  Unknown      0.0     0.0   0.20  Idle         **********

Mine all say Unknown except those that are actually downloading or Seeding…..

Last edited on 1254625403|%e %b %Y, %H:%M %Z|agohover By IAmParadox + Show more
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254625275|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1254647520|%e %b %Y, %H:%M %Z|agohover

Mmmm…
Not very script-friendly if they keep changing output all the time and even within the same version….. It's quite common to write scripts using the output of commands….
As I already told you I'm currently not downloading anything, so I checked my friend's transmission which also had 1.75, but his is running on DD-WRT and that 9117 didn't make it into optware…

I will work on it this afternoon…..
I want to keep it backward-compatible too….

Unfold Re: Updated trans_watchdog by fraterfrater, 1254647520|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
bzhoubzhou 1254712762|%e %b %Y, %H:%M %Z|agohover
$ /opt/bin/transmission-remote -V
Transmission 1.75 (9117)
Reply  |  Options
Unfold Re: Updated trans_watchdog by bzhoubzhou, 1254712762|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1254982144|%e %b %Y, %H:%M %Z|agohover

I've been thinking, would it be possible to get some new features added? I was thinking maybe a way to have slightly different settings for different trackers, for instance, I have a private tracker I use to get most of my TV shows, so, I need to maintain a certain ratio there, but, other things I get from places like TPB, etc. I don't have to seed quite so long….(I know, call me a bad person if you want) and, I would also like it, if, after seeding is done, it will move it from the current final directory, to another directory, either based on tracker name, filename, or some other criteria. I know this seems silly, since I can have it moved to any directory I want once it is downloaded, and while it is still seeding, but, it would help me keep track of what is actually done, and can be renamed, and what is still seeding, but, available to watch (my work directory is inaccessible from the network, so people won't try to watch stuff that isn't finished downloading yet…)

Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1254982144|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
fraterfrater 1255029029|%e %b %Y, %H:%M %Z|agohover

If you want renaming you should really look into my mvmovie & mkdvd

Reply  |  Options
Unfold Re: Updated trans_watchdog by fraterfrater, 1255029029|%e %b %Y, %H:%M %Z|agohover
Re: Updated trans_watchdog
IAmParadoxIAmParadox 1255030423|%e %b %Y, %H:%M %Z|agohover

I did, and I couldn't get all the perl modules to install to make it work. Also, you either need to move the settings to the beginning of the file, or make a conf for that one, too… it's a bitch trying to figure out exactly what should be configured when you hardcode everything.

Last edited on 1255030528|%e %b %Y, %H:%M %Z|agohover By IAmParadox + Show more
Reply  |  Options
Unfold Re: Updated trans_watchdog by IAmParadoxIAmParadox, 1255030423|%e %b %Y, %H:%M %Z|agohover
New Post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License