I've been working a personal project and I'd like to share my findings.
My goal with this project was to create a (shell only) setup which downloads my favorite tv shows published by Eztvefnet automatically. It would then archive different tv shows into different directories. Because of limited hard disk space I also wanted a implement an auto deleting system which would find all the oldest episodes and delete them when reaching a certain maximum in hard disk space left. This way I could leave the server alone for a long period of time and really wouldn't have to worry about it at all. Everything would be 100% automatic.
Ive been able to solve all these problems and have a working setup with some minor glitches. Here is a summary:
Automatic rss downloading and parsing = 100% working
Automaticly downloading torrents = 95% working. Let me explain :
Using bittorrent python software to download the torrents wont allow me to automatically drop the torrents when they are done. So I had to create a separate cronjob which would delete the .torrent files when they would reach a certain age. The .torrent file gets deleted when its detected as being older than 8 hours. This causes bittorrent to drop the torrent. And moves the episode from a incomplete folder to a fresh episodes folder.
Archiving episodes. = 100% working (needs better implementation)
Deleting oldest shows = 100% working.
To be able to do this Ive written plenty of scripts and here is an explanation of how these scripts works.
Main - Script - starts the Nucleus app which downloads the torrents. The Script takes care of renaming the torrent file from something like 154325 to 154325.torrent so that Bittorrent will recognise the file as a torrent. It then moves the torrents to the directory which I have Bittorrent whatching for torrents. This also deletes the torrent and moves the episode to the fresh episodes directory. I have this on crontab 1 every hour.
Btstart script
Starts startbt script in screen mode. I let local.start start this script so that Bittorrent is automatically started when the machine is rebooted.
Startbt Script
This starts BitTorrent with selected options and ulimit so that if BitTorrent crashes it will automatically restart.
Cleanspace Script
This will detect if partition is 80% or more full and if so detect oldest files and delete them. I have this crontabed every 6 hours.
Archive Script
This will move selected episodes to their respected directories. I really would like to see if someone can come up with a better way to do this. As of now you have to manually enter the name of each show and which directory it should be placed in. If someone can create something automatic here I would be extremely grateful.
Lastly I will post a link to a zip archive where u can find my scripts plus nucleus 1.07b which I used to get the torrent files. If u want to implement this using my scripts u will have to change them to fit your specific settings. I use crontab to execute these scripts at a regular basis. If u need help with setting this up Ill be happy to try.. Also If you can improve this setup and share it with me Id be very glad
Regards, Berkz
Link = http://rapidshare.de/files/15201136/auto-tv.rar.html


