Page 1 of 2 12 LastLast
Results 1 to 16 of 21

Thread: Looking for an advanced folder watcher

  1. #1
    HEXUS.social member Agent's Avatar
    Join Date
    Jul 2003
    Location
    Internet
    Posts
    19,168
    Thanks
    735
    Thanked
    1,607 times in 1,045 posts

    Looking for an advanced folder watcher

    Have found a few basic things online, but nothing as powerful as I need.

    I need something that will monitor a folder at set intervals (or times), then move file X to another location.

    File X will always have the same few characters the same, with the last part of it changing. There will be other files in the directory so its important that it only moves what I want.

    Furthermore, once the file has been moved, after a week I want it to be deleted.

    Thanks for any help
    Quote Originally Posted by Saracen View Post
    And by trying to force me to like small pants, they've alienated me.

  2. #2
    TiG
    TiG is offline
    Walk a mile in other peoples shoes...
    Join Date
    Jul 2003
    Location
    Questioning it all
    Posts
    6,213
    Thanks
    45
    Thanked
    48 times in 43 posts
    why can't you do this with scheduled tasks?. Basic i know but a batch file to do a move ABC*.log scheduled every 15mins?. another scheduled task to delete files over a week old. Not that difficult really.

    Or look at microsofts power shell for windows.

    TiG

  3. #3
    HEXUS.social member Agent's Avatar
    Join Date
    Jul 2003
    Location
    Internet
    Posts
    19,168
    Thanks
    735
    Thanked
    1,607 times in 1,045 posts
    Id considered it, but I remember trying this before and it always went wrong if the file was open / being written to [This was years ago though]. Is this still the case? If not, I will give it a shot

    If its being written to / in use, it MUST not be touched
    Quote Originally Posted by Saracen View Post
    And by trying to force me to like small pants, they've alienated me.

  4. #4
    TiG
    TiG is offline
    Walk a mile in other peoples shoes...
    Join Date
    Jul 2003
    Location
    Questioning it all
    Posts
    6,213
    Thanks
    45
    Thanked
    48 times in 43 posts
    Well you didn't mention that

    I'd expect you'd get issues with open files, how long we talking them being open?.

    Powershell certainly allows what you are wanting, i've just been experimenting with it and it is amazing at achieving things like this, just a fairly steep learning curve at the start.

    TiG

  5. #5
    Sublime HEXUS.net
    Join Date
    Jul 2003
    Location
    The Void.. Floating
    Posts
    11,819
    Thanks
    213
    Thanked
    233 times in 160 posts
    • Stoo's system
      • Motherboard:
      • Mac Pro
      • CPU:
      • 2*Xeon 5450 @ 2.8GHz, 12MB Cache
      • Memory:
      • 32GB 1600MHz FBDIMM
      • Storage:
      • ~ 2.5TB + 4TB external array
      • Graphics card(s):
      • ATI Radeon HD 4870
      • Case:
      • Mac Pro
      • Operating System:
      • OS X 10.7
      • Monitor(s):
      • 24" Samsung 244T Black
      • Internet:
      • Zen Max Pro
    If you get going in batch files this this should help - http://www.ericphelps.com/batch/samples/samples.htm

    (\__/)
    (='.'=)
    (")_(")

  6. Received thanks from:

    TiG (21-06-2007)

  7. #6
    TiG
    TiG is offline
    Walk a mile in other peoples shoes...
    Join Date
    Jul 2003
    Location
    Questioning it all
    Posts
    6,213
    Thanks
    45
    Thanked
    48 times in 43 posts
    Oooo nice Stoo, but i'm fairly sure that there isn't a function to check accessibility on files tho. Depends on what agents doing if you can ignore/work round it

    TiG

  8. #7
    Administrator Moby-Dick's Avatar
    Join Date
    Jul 2003
    Location
    There's no place like ::1 (IPv6 version)
    Posts
    10,665
    Thanks
    53
    Thanked
    385 times in 314 posts
    robocopy can be suprisinly powerfull in this case ?
    my Virtualisation Blog http://jfvi.co.uk Virtualisation Podcast http://vsoup.net

  9. #8
    Member
    Join Date
    Jun 2007
    Location
    Edinburgh
    Posts
    68
    Thanks
    4
    Thanked
    3 times in 3 posts
    • Uncle Psychosis's system
      • Motherboard:
      • Asus P5N-E SLI
      • CPU:
      • Intel Core2Duo E4300
      • Memory:
      • 2GB
      • Graphics card(s):
      • Nvidia 8600GT
      • Case:
      • Lian-LI PC7
    This would be easy to do with a cron job in Linux...assuming you dont actually want to install Linux then you might be able to do it with some kind of VMware?

    Sam
    "bother", said Pooh. "There's an infinite number of monkeys at the door wanting to sue A.A.Milne for plagiarism."

  10. #9
    Theoretical Element Spud1's Avatar
    Join Date
    Jul 2003
    Location
    North West
    Posts
    7,494
    Thanks
    335
    Thanked
    313 times in 249 posts
    • Spud1's system
      • Motherboard:
      • Gigabyte Aorus Master
      • CPU:
      • 9900k
      • Memory:
      • 16GB GSkill Trident Z
      • Storage:
      • Lots.
      • Graphics card(s):
      • RTX3090
      • PSU:
      • 750w
      • Case:
      • BeQuiet Dark Base Pro rev.2
      • Operating System:
      • Windows 10
      • Monitor(s):
      • Asus PG35VQ
      • Internet:
      • 910/100mb Fibre
    A little Windows Powershell commandlet would do this with ease, or a tiny .NET program/service using the FileSystemWatcher class

  11. #10
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts
    Quote Originally Posted by Uncle Psychosis View Post
    This would be easy to do with a cron job in Linux...assuming you dont actually want to install Linux then you might be able to do it with some kind of VMware?

    Sam
    nothing like as easy with msh (PowerShell)!

    Myself thou i'd be less intrested in a polling approach.

    I'd probably nock something up using a directorywatcher in c#, very easy.
    throw new ArgumentException (String, String, Exception)

  12. #11
    HEXUS.social member Agent's Avatar
    Join Date
    Jul 2003
    Location
    Internet
    Posts
    19,168
    Thanks
    735
    Thanked
    1,607 times in 1,045 posts
    Quote Originally Posted by TiG View Post
    Well you didn't mention that

    I'd expect you'd get issues with open files, how long we talking them being open?.

    Powershell certainly allows what you are wanting, i've just been experimenting with it and it is amazing at achieving things like this, just a fairly steep learning curve at the start.

    TiG
    The exact scenario is this

    I built a Media Centre for my dad not too long back (Win MCE) and he uses it for recording everything.
    In the back room they still use a VCR for recording. This is exclusively used by my mom for recording Eastenders (yes I know :rolleyes). The VCR quality is crap, mixed with hardly any signal in that room make it unmatchable for her some nights. The main TV is connected to a huge roof aerial, so is always fine.

    I have an Xbox (1) with XBMC, which will happily play the ms-dvr files that MCE records in.

    On the MCE machine, I want it to watch for the creation of a recording of Eastenders (pretty easy due to the way its named by MCE), then move these to a separate folder. This folder is then shared on the network, with XBMC pointing to this location as default for the "videos" option in its interface.
    After a week, these must be deleted to keep space use on the Media Centre down.

    Why not just share the folder for all the recordings? 2 reasons...
    Firstly, my dad is pretty likely to end up deleting them on accident before she has watched them.

    Secondly, they will show up in his "Recorded TV" which will annoy him hugely (not that I blame him )

    Whatever moves the file must be graceful when something unexpected happens (like it being open, or being written to if its currently being recorded).
    If the OS throws up an error, it could dump MCE and drop to the desktop.

    This scares my dad.

    Quote Originally Posted by Uncle Psychosis View Post
    This would be easy to do with a cron job in Linux...assuming you dont actually want to install Linux then you might be able to do it with some kind of VMware?

    Sam
    Good idea, but a total over-kill for this problem im afraid. I wouldn't dream running a virtual machine on a media centre
    Quote Originally Posted by Saracen View Post
    And by trying to force me to like small pants, they've alienated me.

  13. #12
    TiG
    TiG is offline
    Walk a mile in other peoples shoes...
    Join Date
    Jul 2003
    Location
    Questioning it all
    Posts
    6,213
    Thanks
    45
    Thanked
    48 times in 43 posts
    Eastenders is a fixed schedule for broadcast, just get it to copied on the scheduled task after its shown?. 9pm should be fine.?

    TiG

  14. #13
    HEXUS.social member Agent's Avatar
    Join Date
    Jul 2003
    Location
    Internet
    Posts
    19,168
    Thanks
    735
    Thanked
    1,607 times in 1,045 posts
    I had thought of that....and here comes the but

    BUT, due to it having 2 tuners in (1 watching, 1 recording) there is a chance that the recording might get cancelled from BBC3 and dropped to BBC2 if he wants to record something himself, which are at different times.
    To be honest though, I think its the best way to go now even if it means setting up multiple schedules. Anything else is just getting a bit silly.

    Another question thats kinda related, is there anyway to easily () rename a file such as:

    Radio 1's One Big Weekend_BBC THREE_20_05_2007_23_29_00.dvr-ms to
    Radio 1's One Big Weekend 20th May 23-29.dvr-ms

    Basically the file structure is always
    [Program Title]_[Channel Name]_[Day]_[Month]_[Year]_[Hour]_[Seconds].[Extension]

    Cheers
    Quote Originally Posted by Saracen View Post
    And by trying to force me to like small pants, they've alienated me.

  15. #14
    TiG
    TiG is offline
    Walk a mile in other peoples shoes...
    Join Date
    Jul 2003
    Location
    Questioning it all
    Posts
    6,213
    Thanks
    45
    Thanked
    48 times in 43 posts
    I'd probably do this with a vbscript and make use of windows scripting host to execute it, Using your definition to do a type cast on date and do a rename on the file.

    But i'm too tired to write you it at the moment.

    TiG

  16. #15
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts
    you can do this with MSH (PowerShell)

    its a free microsoft download dagnabbit!
    throw new ArgumentException (String, String, Exception)

  17. #16
    TiG
    TiG is offline
    Walk a mile in other peoples shoes...
    Join Date
    Jul 2003
    Location
    Questioning it all
    Posts
    6,213
    Thanks
    45
    Thanked
    48 times in 43 posts
    you not found the learning curve pretty sharp tho?

    TiG

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Silverstone FM121 & akasa pro fan control problem.. :(
    By jackvdbuk in forum Chassis and Mods
    Replies: 7
    Last Post: 05-12-2006, 09:31 PM
  2. Antec Sonata II - fast running PSU fan
    By martin.evans in forum PC Hardware and Components
    Replies: 2
    Last Post: 02-11-2005, 10:11 AM
  3. Fan Wire extensions?
    By Andeh13 in forum SCAN.care@HEXUS
    Replies: 0
    Last Post: 18-10-2005, 07:07 PM
  4. Opinions needed on alternate fan placement ideas
    By leon in forum Chassis and Mods
    Replies: 3
    Last Post: 19-02-2004, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •