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

Watch a folder for file extensions

Options
  • 12-09-2009 7:51pm
    #1
    Registered Users 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 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 Posts: 13,999 ✭✭✭✭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 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 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 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 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.


  • Moderators, Technology & Internet Moderators Posts: 37,485 Mod ✭✭✭✭Khannie


    I like it.


  • Registered Users Posts: 590 ✭✭✭bman


    Khannie wrote: »
    I like it.

    Me too! Nice and neat.


  • Registered Users Posts: 3,735 ✭✭✭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