Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Hello,
I am trying to run two scripts to download torrents automatically. I am using them from: http://www.horto.ca/?p=10
The first is the torrentwatchdog.sh script which monitors a folder for .torrents and adds them to Transmission and then deletes the .torrent file afterward. The other is a cron job to run this every hour. Pretty simple, except I think maybe my permissions are wrong? But I can't figure out what I'm missing?
Here is the script:
#!/bin/sh ########################################################################### # script to monitor a specific directory for new .torrent files. # if found, queue them up in transmission # and when done downloading, pause the torrent # w 10/20/08 horto # u 10/29/08 horto - implmented "make transmission stop after seeding 1:1" ########################################################################### TORRENTDIR=/mnt/HD_a2/Torrents/torrents WDLOG=/mnt/HD_a2/logs/torrentwd.log TRANSMISSION_REMOTE=/ffp/bin/transmission-remote # check incoming TORRENTDIR for FILE in $TORRENTDIR/*.torrent; do if [ "$FILE" != "$TORRENTDIR/*.torrent" ]; then echo [`date`] "$FILE" added to queue. >> $WDLOG $TRANSMISSION_REMOTE -a "$FILE" rm "$FILE" echo [`date`] "$FILE" deleted from directory. >> $WDLOG sleep 1 fi done # stop completed downloads for i in `/ffp/bin/transmission-remote -l | grep Done | grep -v Ratio | awk '{print $1}'"`; do echo [`date`] stopping torrent id $i >> $WDLOG $TRANSMISSION_REMOTE -t $i -S done exit 0
Here are the permissions for the above referenced folders/programs:
directory /mnt/HD_a2/.transmission-daemon has 755, owner nobody:root
directory /mnt/HD_a2/Torrents has 755, owner nobody:root
directory /mnt/HD_a2/Media has 755, owner nobody:root
directory /mnt/HD_a2/logs has 755, owner nobody:root
file /ffp/bin/.transmission-remote has 755, owner root:root
file /ffp/bin/.transmission-deamon has 755, owner root:root
And the torrentwd.log file says:
/ffp/var/scripts/torrentwatchdog.sh: Permission denied [Wed Apr 28 01:25:12 GMT 2010] /mnt/HD_a2/Torrents/torrents/[www.seedpeer.com] Slackware 12 2 Dvd.SEEDPEER.torrent added to queue. [Wed Apr 28 01:25:14 GMT 2010] /mnt/HD_a2/Torrents/torrents/[www.seedpeer.com] Slackware 12 2 Dvd.SEEDPEER.torrent deleted from directory. [Wed Apr 28 01:34:13 GMT 2010] /mnt/HD_a2/Torrents/torrents/The_Hurt_Locker_2008_BRRip_H264_5.1_ch_SecretMyth__Kingdom_Release_.torrent added to queue. [Wed Apr 28 01:34:14 GMT 2010] /mnt/HD_a2/Torrents/torrents/The_Hurt_Locker_2008_BRRip_H264_5.1_ch_SecretMyth__Kingdom_Release_.torrent deleted from directory. awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User Unexpected response: <h1>401: Unauthorized</h1>Unauthorized User awk: No such file or directory
I don't have a username/pw set for Transmission (v1.92) as I just login to the web interface with blank username/pw. Does this mean I have to set one up? If so, how? I can't find how to do that in the web interface.
Thanks to anyone who can help
Offline
You do not have awk installed and/or awk is not in the PATH when a cron job runs.
Install awk if it is not installed.
Consider putting the full pathname to the awk executable in your script or set the PATH variable at the top of the script so that it includes the directory containing awk, as well as everything else the script needs.
Debugging tip: add an echo $PATH statement to your script so you can see what the effective path is.
The second for loop will always fail to set i correctly with awk missing, so calling transmission will always fail too.
Offline
Turns out the settings.json file had the wrong permissions. So, what I think was happening was transmission-remote could not run (bc the daemon never started) and since remote didn't run, awk didn't have a "file or directory" to act upon. (I had to check transmission's log to find the settings.json error)
It's working now, no errors. Thanks!
Last edited by bound4h (2010-04-29 17:58:05)
Offline
bound4h,
What exactly did you do to fix it?
Thanks
Offline
Since the transmission.sh (/ffp/start/transmission.sh) initiates the program under the user 'nobody', it could not read the settings.json file because it had diff permissions denying access. chown nobody /path/to/settings.json did the trick (or i guess a global read would have worked too).
PS- Check the transmission log file if you're having problems running the program itself (as was the root cause of my issue) aside from any scripts you're trying to run alongside it. (/mnt/HD_a2/.transmission-daemon/transmission-daemon.log)
Last edited by bound4h (2010-05-02 07:50:28)
Offline
Still not working and the log file shows nothing out of the ordinary...
Offline
Hi Kyle,
last week, it seemed that automatic stopped working for me. I'd been using it for about 12 months or so, using an RSS feeder.
I've rebooted the NAS and Transmission comes up fine, but automatic doesn't start. I've also tried to start it manually, and all the log file comes back with is
'Segmentation fault'.
"automatic -f -v 3 -c /ffp/etc/automatic.conf >automatic.log 2>&1"
gives me the Segmentation fault
I've attached my conf file, which as you can see is pretty old since some of the shows are no longer on
I've not tweaked anything (other than the showrss userid) before uploading.
-rwxrwxrwx 1 root root 620 Mar 29 2010 /ffp/start/automatic.sh
I'm not sure what changed to make it stop loading....
any ideas?
Thanks !
Offline
@tanstaafl1963: no ' " ' after names in patterns; normal?
Offline
Is automatic in your PATH? Maybe try using the absolute rather than relative path to automatic?
Offline
@tanstaafl1963,
sharks is right, it looks like you left off the " at the right of your patterns (at least the bottom 15 or so).
Offline