May 14, 201115 yr I finally got this setup and running...thought I'd share my experiences (and also create a log for myself on how I set it up for later). The base OS for my TV viewing/recording is Windows 7 (using the Windows Media Center to do so). Because I used the 'base' install and config - it saves my recorded files in: c:\Users\Public\Recorded TV and I'd like to copy the files to a spot on my unRaid server that I have mapped on the Win7 box as Z: (which, in my case is \\192.168.1.236\Recorded_TV) <<--but the 'Z:' mapping won't work - more on that later You can find a good explanation of the Robocopy command and it's parameters here: http://ss64.com/nt/robocopy.html Ok...now down to the meat of it all - I chose to use the 'Task Scheduler' that's built into Windows and do the backup at 3am (because I don't think any programs will be recording at that time) To access the Task Scheduler program, go to: Start --> All Programs --> Accessories --> System Tools --> Task Scheduler In the right hand column, you'll see an option to 'Create Task' In the General Tab - complete the Name and Description entries (and I chose 'Run whether user is logged on or not - but that's a big deal as that's the only user and that system is always on) In the Triggers Tab - setup a new trigger 'On a Schedule' - Daily at 3:00am In the Actions Tab - fill in the following: Action --> 'Start a Program' Program / Script --> C:\Windows\System32\Robocopy.exe Add arguments (optional) --> c:\Users\Public\Recorded_TV \\192.168.1.236\Recorded_TV *.wtv /mov /tbd /log+:robocopy.log /np /nfl /njh first entry: c:\Users\Public\Recorded_TV <--this is where your originally recorded files are...NOW chances are that the default entry is "Recorded TV" (without the underscore)...SO you have a few options here. You can use quotation marks around the whole thing like "c:\Users\Public\Recorded TV" or you can open a Command window and create a symbolic directory link (you can't just make a shortcut - that doesn't work). To make the symbolic link (so that Recorded_TV will point to the directory Recorded TV), open 'Run as Administrator' Command Prompt Window (do that by clicking: Start --> All Programs --> Accessories --> (and now RIGHT click on) Command Prompt (to choose 'Run as Administrator'). This will open the Command Prompt / DOS window. Now do 'cd c:\Users\Public' within that directory should be your original directory entitled "Recorded TV". Now issue the command: mklink /D Recorded_TV "Recorded TV" Now when you do a directory, you'll see something like this: 05/14/2011 05:41 AM <DIR> Recorded TV 05/13/2011 09:55 PM <SYMLINKD> Recorded_TV [Recorded TV] this means that now the directory Recorded_TV will point/link to the "Recorded TV" directory and you can reference it without quotes (because there is no space in the directory anymore) second entry: \\192.168.1.236\Recorded_TV You may be tempted to just call this by the 'map network drive' name that you might have already to this directory...DON'T DO IT. This caused me to go round and round. The problem is that while your USER account has the mapping, the shell/account that it runs this task scheduler in DOES NOT have the mapping. So you'll need to use what's called the UNC name of the location - which in my case is \\192.168.1.236\Recorded_TV (which is one of the entries in 'unRAID Main' --> Shares that I have on my unRAID setup) third entry: *.wtv This is what you want to copy. To do a simple test, I would change this to some testing.txt file (which is small and easy to see if it worked) and create a testing.txt file within my Recorded_TV files directory just to see if it get's moved to the server (rather than wait on the 2Gb+ files to move). Eventually, once you know it's working..change it back to *.wtv to just move the recordings fourth entry: /mov This will 'move' the file (copy it from one place to another...then delete from original source once successfully copied) fifth entry: /tbd "Wait for sharenames to be defined".....I'm not entirely sure I need these, but what the heck - didn't hurt anything and is probably a good idea to get the unRAID system time to spin-up /log+:robocopy.log this tells it to log the output of the robocopy program (probably a good idea - at least when testing). Because we had set within the 'Task Scheduler' the 'Start in (optional)' directory below - this writes the file to my desktop for easy finding. You could turn this off once it's working, but I like to see how it's doing /np "no progress - don't display % copied". Just run it one time without this entry and you'll soon see why I turn it off (one, because it's running automatically and you don't see anything output to the screen anyways and, two, it mega-fills up the log file with junk) /nfl "No File List - don't log file names". Again, just run it one time without this option and you'll see why I turn it off. The Robocopy command will list out all of the files it finds that match the '*.wtv' or whatever you have it set to on BOTH THE SOURCE AND DESTINATION. I don't need to see ones that are already copied?! /njh "No Job Header". this will explain what it's going to do...probably neat to leave off when testing to fully see what it's doing...but, for daily/normal use - I know what it's supposed to be doing. turned off for normal logs. Start in (optional) --> C:\Users\hdtv\Desktop (my login / username for this computer is 'hdtv', so your's might be 'mfarrell' or 'mightyman' or whatever - this is just where the Desktop is for the logged in user) In the Conditions Tab - choose what makes sense for your setup In the Settings Tab - choose what makes sense for your setup (I choose the default settings) - and make sure that 'Allow Task to be run on demand' is checked (for testing) Now to test your task...click on 'Task Scheduler Library (left column in Task Scheduler) and choose your just made entry....in the right hand column, choose 'Run'. You can click on 'Display All Running Tasks' to see how it's doing and/or read the file 'robocopy.log' file (which in my case is created on the desktop). Hope that helps/works for you
April 29, 201214 yr Do you have UAC on? It won't let me use my admin account on my htpc because it doesn't have a password. If I select run while user IS logged on then it accepts the task but the task failes with Robocopy error 16 which deals with invalid credentials. Annoying how NOT having a password can complicate things! Do you mind listed all options you have checked in your task and letting us know if you have UAC enabled. Thanks!
April 29, 201214 yr Not sure yet if UAC needs to be turned off or not but /tdb is not an option except on retries. Not sure how you got this command to work with that option in there.
April 30, 201214 yr Do you have UAC on? It won't let me use my admin account on my htpc because it doesn't have a password. If I select run while user IS logged on then it accepts the task but the task failes with Robocopy error 16 which deals with invalid credentials. Annoying how NOT having a password can complicate things! Do you mind listed all options you have checked in your task and letting us know if you have UAC enabled. Thanks! Some alternatives: Open the Run window (WinKey + R) type "control userpasswords2" and press ENTER Press CTRL-ALT-DEL, click Change Password and then choose a password Tick the "Users must enter a user name and password" checkbox - make sure the account you use is selected and then untick it. Click OK Windows will prompt you for the password you just entered You account is now password protected but Windows will log in automatically. Modify your scheduled task to use the password. If you really want a blank password for some other reason, create a new user account with a password and have the scheduled task run as that user. In "control userpasswords2" tick the "Users must enter a user name and password" checkbox Select the account you log in with that doesn't have a password Untick the "Users must enter a user name and password" checkbox Windows should now log in with that user automatically (without bringing up the "Switch user" screen like it normally does when you add more than one account to a computer) Modify the scheduled task to run as the new user and provide the password
March 21, 201313 yr I recently set this up to move my Windows 7 WMC TV recordings to a public share on my unRAID server. Here are just some updated information: 01. I used RichCopy, instead of RoboCopy. RichCopy is an update to RoboCopy. 02. I set up a task scheduler that triggers off the Media Center Recording event 1: Begin task on an Event. Log: Media Center Source: Recording Event ID: 1 This will execute the command RichCopy with the customized options after a recording has completed. The only caveat is that if there is a back to back recording, then RichCopy will report as an error the current recording since it is in use. I just set the retry to 2 and RichCopy will continue with the rest of the copying task and ignore the file in used. Of course when that recording is complete, another event 1 is raised and RichCopy will move the last recording. Other notes: I move the recordings to a public share (guest access allowed). Since the WMC thumbnail service runs a the NETWORK id, it will need access to the share to generate the appropriate thumbnail for the recordings.
March 21, 201313 yr set up a trigger for event id 3 as well so it picks up manual recordings as well.
April 20, 201313 yr To make life a little easier with Robocopy you can use a utility called Easy RoboCopy This is a GUI that has all the options for Robocopy as check boxes. There are tooltips as well to help understand what they are for. Once finished you can execute the command or just copy the command with all the switches into your batch file and then get it to run in what ever fashion you decide. For those that want to backup files from a users PC, you can have robocopy check every x minutes for changes and then copy the changes only - many options available. The problem with a schedule task and robocopy is that it will have a command window visible (was last time I played with this). There are command switches to make it hidden but you could also create a service out of it by using the NSSM (Non-Suckin Service Manager) utility so it runs in the background invisible to the user. I think I tried RichCopy and ended up going back to RoboCopy - can't remember why, but you need to ge thte one that suits you the most. Mick
Archived
This topic is now archived and is closed to further replies.