Win 7 WMC automatically moving recordings to NAS

Post Reply
byronomo

Posts: 38
Joined: Thu Mar 14, 2013 10:19 am
Location:

HTPC Specs: Show details

Win 7 WMC automatically moving recordings to NAS

#1

Post by byronomo » Tue May 10, 2022 12:57 pm

Can anyone recommend an EASY way to automatically move recordings from 8 client PCs on my LAN to my Synology NAS (on the same LAN)?

Windows Home Server used to do this, but since moving to Synology I have not been able to find a way to replicate this functionality (move each recording as soon as possible after its completion in order to maximize recording space on the client PCs).

I did stumble across Recorded TV Manager 4 ( http://www.fjdrasch.com/v4/downloadV4.htm ) which seems like it should do the trick but apparently it is no longer available for purchase, so I have no way of obtaining it.

Anyone have suggestions for an easy way to do this?

User avatar
StinkyImp

Posts: 669
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#2

Post by StinkyImp » Tue May 10, 2022 3:49 pm

byronomo wrote: Tue May 10, 2022 12:57 pmI did stumble across Recorded TV Manager 4... but apparently it is no longer available for purchase, so I have no way of obtaining it.
I followed your link and the website said that V3 was available for free but the link was dead. I decided to search for the download and found the V4 version marked as FREE on Software Informer. https://recorded-tv-manager-media-cente ... r.com/4.3/

I have zero information on its veracity. YMMV ;)

byronomo

Posts: 38
Joined: Thu Mar 14, 2013 10:19 am
Location:

HTPC Specs: Show details

#3

Post by byronomo » Tue May 10, 2022 6:12 pm

StinkyImp wrote: Tue May 10, 2022 3:49 pm I decided to search for the download and found the V4 version marked as FREE on Software Informer. https://recorded-tv-manager-media-cente ... r.com/4.3/

I have zero information on its veracity. YMMV ;)
Thanks for the reply. Unfortunately, that link ultimately goes back to the original site and returns a "Page Not Found" when attempting to initiate the download. The seeming huge advantage of v4 versus v3 is the ability to configure all the clients on a single networked PC rather than having to install/configure the software on each client.

ozzy84

Posts: 3
Joined: Tue May 10, 2022 8:50 pm
Location:

HTPC Specs: Show details

#4

Post by ozzy84 » Tue May 10, 2022 8:56 pm

i have install for win 7 at home, will send tomorrow if still needing.

ozzy84

Posts: 3
Joined: Tue May 10, 2022 8:50 pm
Location:

HTPC Specs: Show details

#5

Post by ozzy84 » Tue May 10, 2022 8:57 pm

ps, still use this everyday to move recordings to SAS

byronomo

Posts: 38
Joined: Thu Mar 14, 2013 10:19 am
Location:

HTPC Specs: Show details

#6

Post by byronomo » Tue May 10, 2022 9:11 pm

ozzy84 wrote: Tue May 10, 2022 8:56 pm i have install for win 7 at home, will send tomorrow if still needing.
Thanks a million!

Space

Posts: 2838
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#7

Post by Space » Tue May 10, 2022 9:21 pm

I have a relatively simple AutoHotKey script that I used for moving recordings off of my main recording drive to an external drive. I used it during the Olympics since I recorded all the coverage and it would otherwise have filled up my recording drive very quickly.

It may be a bit of work to get it working if you are not familiar with this type of stuff, so only attempt this if you have a relatively good understanding, as I have left out certain details that I would expect someone with scripting and Windows knowledge to already know.

It requires you to install AutoHotKey on your machine ("Download current version", not the v2 Beta or v1.0 (deprecated)).

I used AutoHotKey (a.k.a. AHK) for all kinds of stuff on my HTPC (until it died recently) as well as other PCs, so I have a bunch of little scripts tailored to my system, but this one is relatively generic and can be used by anyone with just a few minor changes.

Some notes:
  • You should put this script in a file with an extension of ".ahk". It is a daemon, so you need to run it once or have the system run it when it starts up (there are various ways to do this).
  • You need to edit the script and change "source_dir" and "dest_dir" to be the folder name of your recording folder and the folder name you want to move the recordings to, respectively.
  • Since this is a daemon (you run it once and it continues to run indefinitely) you need to specify how often you want it to look for new files to move, I have it currently set to 2 hours, but you can change it by changing the "interval" variable. Note that this value is in milliseconds.
  • Near the bottom of the script, you can put several (or just one) "MoveFiles" calls, this is what is run every "interval", you can specify a file glob pattern (some of the ones I used for the Olympics are commented out) to indicate which files you want to move, it is currently set to move ALL files with the ".wtv" extension, "*.wtv".
  • The script will move the file to a new filename (with a ".tmp" extension) first, and then rename that file back to the original file name, this is so that if the destination folder is a "Media Library" that is being watched by WMC it will not load the metadata from the file before it is completely moved over. This prevents WMC from having incomplete metadata in it's database for the recording.
  • Note that I stole some code to make sure the PC does not go to sleep while it is moving the large video files, but it should not hurt to leave that in there even if you don't need it (i.e.: you don't have your PC automatically go to sleep).
  • Currently, the script will check that the file has not been modified for at least 10 minutes ("min_minutes" variable) before it attempts to move the file, this is so that it does not try to move files that are currently being written to (recording still in progress). I just used 10 minutes and it seemed to work, so I left it, you can try changing it to a shorter period of time if you wish, I haven't really experimented with shorter times. Be careful because Windows does not seem to update the "modified time" very frequently when it is constantly writing to a file, I would personally leave it at 10 minutes (or even increase it if you see problems with it trying to move files that are still being written to).
I wrote this script relatively quickly and the only testing I did was during the Summer and Winter Olympics this year. It worked well, but I cannot guarantee that it will work for you on your system. Note that AHK can convert a script to an ".exe" file (right click on it in explorer to find the "compile script" option), this puts the interpreter inside the file with the script so that you don't need to have AHK installed on the system to run the resulting executable file and also makes it a bit easier to run at startup (you only need to specify the *.exe file to run instead of the AHK executable and the script name).

Note that I took some of the code in this script from other sources, so thanks to those people who posted some of the code snippets that I may have used in this script.

Code: Select all

; Only allow a single instance of this script to be run at the same time
#SingleInstance ignore

source_dir := "X:\Recorded TV"
dest_dir := "R:\Videos\Olympics"

MoveFiles(glob) {
    Global source_dir, dest_dir

    PreventSleep(true)

    min_minutes := 10
        
    Loop Files, %source_dir%\%glob%
    {
        age_minutes := DateDiff(A_LoopFileTimeModified,A_Now,"minutes")
            
        if (age_minutes >= min_minutes) {
            tmp_name := A_LoopFileName . ".tmp"
            FileMove, %A_LoopFileLongPath%, %dest_dir%\%tmp_name%, 1
            FileMove, %dest_dir%\%tmp_name%, %dest_dir%\%A_LoopFileName%, 1
        }
    }

    PreventSleep(false)
}

DateDiff(start, end, unit)
{
    diff := end
    diff -= start, %unit%
    return diff
}

PreventSleep(tf) {
   static ES_AWAYMODE_REQUIRED:=0x00000040
   static ES_CONTINUOUS:=0x80000000
   static ES_SYSTEM_REQUIRED:=0x00000001

   if (tf) {
       ; true - Prevent PC from going to sleep
       DllCall("SetThreadExecutionState","UInt",ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED)
   } else {
       ; false - Allow PC to go to sleep
       DllCall("SetThreadExecutionState","UInt",ES_CONTINUOUS)
   }
}

interval :=  2 * 60 * 60 * 1000 ; Two hours
;interval :=  60 * 1000 ; One minute
Loop {
	;MoveFiles("2022 Winter *.wtv")
	;MoveFiles("The Olympic Zone*.wtv")
	;MoveFiles("Olympic Hockey*.wtv")
	MoveFiles("*.wtv")

	Sleep %interval%
}

byronomo

Posts: 38
Joined: Thu Mar 14, 2013 10:19 am
Location:

HTPC Specs: Show details

#8

Post by byronomo » Thu May 12, 2022 2:19 am

Space wrote: Tue May 10, 2022 9:21 pm
It may be a bit of work to get it working if you are not familiar with this type of stuff, so only attempt this if you have a relatively good understanding, as I have left out certain details that I would expect someone with scripting and Windows knowledge to already know.
Thanks for your reply. Unfortunately, this is far above my knowledge and skill level. I was finally able to obtain Recorded TV Manager 4 and am giving it a whirl.

adam1991

Posts: 2893
Joined: Sat Jun 11, 2011 2:31 pm
Location:

HTPC Specs: Show details

#9

Post by adam1991 » Sat May 14, 2022 9:48 pm

I'm curious--why 8 client PCs? How are they configured? Is cableCARD involved?

Pardon me for asking, but I simply record directly to the NAS--not with WMC, but with Plex and Silicon Dust tuners. I'm curious how your setup doesn't lend itself to that.

Post Reply