2

On Debian Squeeze, I'd like for ctorrent to automatically open in a screen session if a new torrent file is placed in a particular folder (/home/torrent). Is there an easy way to, in a script, watch for new files being added to a folder and react to this change?

2
  • 1
    Just a though, but why not start a screen session and leave bittornado running in it. With the btlaunchmanycurses.bittornado you just point it at a directory. When new .torrent files are added, it starts automatically.
    – Zoredache
    Nov 4, 2012 at 21:18
  • @Zoredache Though it's too specific to be useful to the rest of the community as an answer, I like this idea and ultimately have decided upon going with this solution.
    – Suchipi
    Nov 4, 2012 at 22:03

3 Answers 3

3

You should check out inotify-wait, that’s exactly what you need:

https://github.com/rvoicilas/inotify-tools/wiki

1

You can write a bash script with the combinations of "ls" and "find" command to determine if the folder has new torrent files. And then run the script periodically with cron.

Alternatively you can use rTorrent or Transmission-cli. Both has the built in feature to watch a directory for torrent files.

1

You may want to use incron, from the description:

incron is an "inotify cron" system. It works like the regular cron but is driven by filesystem events instead of time events.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .