Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Watch a folder for file extensions

  • 12-09-2009 6:51pm
    #1
    Registered Users, Registered Users 2 Posts: 590 ✭✭✭


    Hi,

    Upon downloading *.nzb files to my Desktop I want them to be automatically moved to my nzb queue folder. Is there any easy way to watch a folder (my Desktop) for file extensions without writing a cron task (i.e. I just want my script to trigger when a *.nzb file is there).

    Any help appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 218 ✭✭Tillotson


    You could make a script and put it it in .xinitrc
    Something like this:
    while true
    do
         if [ -a ~/Desktop/*.nzb ]; then
        # Do some stuff
        sleep 1m
    done &
    
    Probably a better way :)


  • Registered Users, Registered Users 2 Posts: 14,048 ✭✭✭✭Johnboy1951


    Why not d/load directly to the required folder?


  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    What Johnboy said. I assume you're using hella. I've linked ~/Desktop/hella to ~/.hellanzb/nzb/daemon.queue. Much handier that way.


  • Registered Users, Registered Users 2 Posts: 590 ✭✭✭bman


    Why not d/load directly to the required folder?

    Yeah, could do this, but using Download Them All so it automatically goes to the Desktop (where all my downloaded files go). I just thought it'd be handy if there was some easy way of doing this.
    Macros42 wrote: »
    What Johnboy said. I assume you're using hella. I've linked ~/Desktop/hella to ~/.hellanzb/nzb/daemon.queue. Much handier that way.

    Using SABnzbdPlus.

    I just download the nzb files and drop them into the queue folder manually at present. I guess I'm just lazy and want to have it done for me automatically :) .


  • Registered Users, Registered Users 2 Posts: 545 ✭✭✭ravydavygravy


    Just use cron. This will take you 10 seconds to setup. Just type "crontab -e" and then put in:
    * * * * * mv ~/Desktop/*.nbz ~/nbz_que_directory
    

    Or download the files direct to the folder...

    Dave


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 590 ✭✭✭bman


    Just type "crontab -e" and then put in:
    * * * * * mv ~/Desktop/*.nbz ~/nbz_que_directory
    

    Yeah, this is probably what I'll use alright. Just thought it'd be a handy feature to be able to watch a folder for certain file types and trigger an event accordingly.

    cron it is so.


  • Registered Users, Registered Users 2 Posts: 5,112 ✭✭✭Blowfish


    There is a much more efficient way of doing it. Create an executable script that takes a .nzb file as an argument and moves it. Stick the script in /bin (or anywhere in your $path variable).

    Then in Firefox itself just set the script as the default program to open when .nzb files are downloaded. That way the script is only ever run when needed.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    I like it.


  • Registered Users, Registered Users 2 Posts: 590 ✭✭✭bman


    Khannie wrote: »
    I like it.

    Me too! Nice and neat.


  • Registered Users, Registered Users 2 Posts: 3,739 ✭✭✭Stuxnet


    Just use cron. This will take you 10 seconds to setup. Just type "crontab -e" and then put in:
    * * * * * mv ~/Desktop/*.nbz ~/nbz_que_directory
    
    Or download the files direct to the folder...

    Dave

    god bless our sys admin:pac:


  • Advertisement
Advertisement