Closed megatrontorrent closed 6 months ago
try /volume1/@appstore/transmission/var/which.sh
#!/bin/sh
chmod -R 0777 $TR_TORRENT_DIR_
/usr/local/python /volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py
Hi Clinton,
I have updated the which.sh file but no luck.
Since then, i've changed the owner & permissions back to "root" for all files & paths involved and added an output line to a log file, after the python call to confirm the contents of which.sh is run.
However, there are no changes to the torrent files or /volume1/downloads/transmission/nzbToMedia/logs/nzbtomedia.log since 2015-11-15 when the since TorrentToMedia.py was last run manually via WinSCP.
Other than the nzbtomedia.log above, is there any other indicator to check if the python script is run?
/volume1/@appstore/transmission/var/which.sh
chmod -R 0777 $TR_TORRENT_DIR_
/usr/local/python /volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py
echo "=======================================================" >> /tmp/torrent-finished.log
echo "/volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called" >> /tmp/torrent-finished.log
set | egrep "^TR_" >> /tmp/torrent-finished.log
/tmp/torrent-finished.log
=======================================================
/volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called
TR_APP_VERSION='2.84'
TR_TIME_LOCALTIME='Tue Nov 17 23:46:13 2015'
TR_TORRENT_DIR='/volume1/downloads/transmission/movies'
TR_TORRENT_HASH='82b48bc95b0688d7d464fbec8668e133f32c1887'
TR_TORRENT_ID='13'
TR_TORRENT_NAME='The.33.2015.720p.WEB-DL.X264.AC3-EVO'
=======================================================
/volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called
TR_APP_VERSION='2.84'
TR_TIME_LOCALTIME='Wed Nov 18 02:16:34 2015'
TR_TORRENT_DIR='/volume1/downloads/transmission/tv'
TR_TORRENT_HASH='16f66c91aca48188ab6327f9e178cab42acaf649'
TR_TORRENT_ID='14'
TR_TORRENT_NAME='The.Flash.2014.S02E07.720p.HDTV.X264-DIMENSION'
=======================================================
/volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called
TR_APP_VERSION='2.84'
TR_TIME_LOCALTIME='Wed Nov 18 03:38:13 2015'
TR_TORRENT_DIR='/volume1/downloads/transmission/tv'
TR_TORRENT_HASH='70e4ad22e87c9d0848b1fc4e02bd41367822c4f1'
TR_TORRENT_ID='15'
TR_TORRENT_NAME='Limitless.S01E09.1080p.HDTV.X264-DIMENSION'
=======================================================
/volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called
TR_APP_VERSION='2.84'
TR_TIME_LOCALTIME='Wed Nov 18 03:42:29 2015'
TR_TORRENT_DIR='/volume1/downloads/transmission/tv'
TR_TORRENT_HASH='dbe617df1aaed14251f26a0ad6983ce20ad1e4ce'
TR_TORRENT_ID='16'
TR_TORRENT_NAME='Scream.Queens.2015.S01E09.720p.HDTV.x264-FLEET'
As mentioned, everything seems to work fine when called directly via winSCP, but three quick thoughts:
1) Does it matter the final default synology directories/categories are named slightly differently from download & processing folders?
Download directories/categories: /volume1/downloads/transmission/tv /volume1/downloads/transmission/movies
Processing directories/categories: /volume1/downloads/torrent/processed/tv /volume1/downloads/torrent/processed/movies
Final directories/categories: /volume1/video/movie /volume1/video/TV show
2) when updating the autoProcessMedia.cfg file I stop the packages for SB, CP & transmission. After making the changes, I then restart the NAS and start the three packages. Is there anything else I should need to do to make sure transmission is looking at the latest version of the file?
3) the reason I ask is that one of my previous passwords referenced in autoProcessMedia.cfg had a hash (#) character in it which the cfg file treated as a comment and split the pwd into two parts.
I have since changed the PWD to something else, however the second part of the old pwd appears as a comment a bit after on the same line - this seems to return even after I have removed the #comment on several occasions.
Thansk again for your help with this.
_MT
export TR_APP_VERSION='2.84' export TR_TIME_LOCALTIME='Tue Nov 17 23:46:13 2015' export TR_TORRENT_DIR='/volume1/downloads/transmission/movies' export TR_TORRENT_HASH='82b48bc95b0688d7d464fbec8668e133f32c1887' export TR_TORRENT_ID='13' export TR_TORRENT_NAME='The.33.2015.720p.WEB-DL.X264.AC3-EVO' /usr/local/python /volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py
Hi Clinton,
From the ssh text, it appears its a permission issue:
-ash: /usr/local/python: Permission denied
Hi Clinton,
Using the following via ssh seems to address the permissions error - I have updated which.sh and will let you know if this runs from transmission automatically
_MT
python /volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py
Hi Clinton,
No luck with calling TorrentToMedia.py automatically with tranmission run as "root".
I've added a couple lines to which, which exports the path to a tmp file before the python script is called.
Does the path below look correct?
PATH=/usr/local/transmission/bin:/usr/local/python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin
/volume1/@appstore/transmission/var/which.sh The bash script that calls TorrentToMedia.py on completion:
#!/bin/sh
chmod -R 0777 $TR_TORRENT_DIR_
echo "=======================================================" >> /tmp/torrent-finished.log
PATH=$PATH:/usr/local/bin
export PATH
echo "PATH=$PATH" >> /tmp/torrent-finished.log
set | egrep "^TR_" >> /tmp/torrent-finished.log
python /volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py
echo "/volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called" >> /tmp/torrent-finished.log
/tmp/torrent-finished.log PATH=/usr/local/transmission/bin:/usr/local/python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin TR_APP_VERSION='2.84' TR_TIME_LOCALTIME='Tue Nov 24 02:14:25 2015' TR_TORRENT_DIR='/volume1/downloads/transmission/tv' TR_TORRENT_HASH='62e59174d223b328492b2321ab987e4703bbc688' TR_TORRENT_ID='30' TR_TORRENT_NAME='Gotham.S02E10.720p.HDTV.X264-DIMENSION' /volume1/downloads/transmission/nzbToMedia/TorrentToMedia.py called
Check the owner/permissions on the autoProcessMedia.cfg file and the logs directory. Failure to write to these would cause the script to exit before anything is logged.
I currently change the permissions via the GUI of WinSCP and both files & directories are showing 0777 with the user* being **root* and group being root.
Just double-checking, in the group file, root has no groups/users associated with it, is the following intended?
root:x:0:
So, how would I update the owner/permissions of the files & directories you mentioned via the command line? something like the below:
chown -R root:root /volume1/@appstore/transmission
chown -R root:root /volume1/downloads/transmission/nzbToMedia/logs
chown -R root:root /volume1/downloads/transmission/nzbToMedia/autoProcessMedia.cfg
chown -R root:root /volume1/@appstore/transmission
should take care of it.
Hi Clinton,
Great work with the nzbToMedia script.
I'm a n00bie & spent the best part of 3 weekends trying to crack the perfect setup, I've followed the provided wiki documentation & I'm so close - just can't seem to get transmission to call a .py script on completion. It currently calls a .sh successfully but then can't get this file to run TorrentToMedia.py
I've tried to modify the startstop script to include the python path and also previously set this in the .sh script too but no joy.
Also double checked all directories have 777 permissions applied and all packages startstop scripts updated to run as the user "auto".
Please help?
_MT
My Setup: Synology ds415play Python 2.7.10 transmission 2.84-10 sickbeard-custom (sickrage git master fork) couchpotato-custom (git master fork)
User permissions User "auto" created with 0777 permissions applied to all of the above.
Scripts & directories: /volume1/downloads/transmission/nzbToMedia
autoProcessMedia.cfg
Download directories/categories: /volume1/downloads/transmission/tv /volume1/downloads/transmission/movies
Processing directories/categories: /volume1/downloads/torrent/processed/tv /volume1/downloads/torrent/processed/movies
Final directories/categories: /volume1/video/movie /volume1/video/TV show
/volume1/@appstore/transmission/var/settings.json Transmission settings:
/volume1/@appstore/transmission/var/which.sh The bash script that calls TorrentToMedia.py on completion:
/volume1/@appstore/transmission/var/logtransNEW.log A portion of the transmission log file that shows which.sh is called on completion:
/var/packages/transmission/scripts/start-stop-status The transmission stopstart script:
/volume1/downloads/transmission/nzbToMedia/logs/nzbtomedia.log The script TorrentToMedia.py works fine when called directly in WinSCP (as root user):