NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 329 330 331 332 333 … 433 Next »
Copy recorded file with .bat not working

Copy recorded file with .bat not working
NebulaOdyssey
Offline

Junior Member

Posts: 11
Threads: 2
Joined: Nov 2011
#1
2011-11-29, 03:34 PM (This post was last modified: 2012-01-08, 12:54 PM by NebulaOdyssey.)
Hi everyone, I'm new to the forum and recent to NPVR.

I have a problem with copying recordings automatically. Basically I got a nas and I want to copy completed recordings to the nas, but only after recording. This reduces the possibility of failure to record do to any network problems or of nas is off.

So I use postprocessing.bat to check that the recorded programme exists. Then I want I to be copied to my nas. check it exists on the nas and report in a log file. simple right.

Now for some reason it just won't work. The .bat file runs and reports in my log that the programme was recorded. But it will not copy the file to my nas? I've also run the same .bat file giving the path to a real recording, i.e acting as %1 in postprocessing.bat, and it runs perfectly fine. Copies and reports successful in my log. If NPVR calls the .bat after a finished recording the file just doesn't seem to copy.

I use:
Copy %1 "R:\recordedtv\"
I've tried with and without trailing \ to no avail.

Can you please help.

Running XP & NPVR latest release.

------------SOLVED-----------
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#2
2011-11-29, 04:22 PM
The recording service runs as a different user account, so wont see your mapped R:\\ drive. You'll probably need to switch to using UNC paths instead.
NebulaOdyssey
Offline

Junior Member

Posts: 11
Threads: 2
Joined: Nov 2011
#3
2011-11-29, 04:39 PM
Thank you sub

Okay, I'll give that a try then. I'm guessing it should see my C:\ okay. I'll test this also by trying to copy to C:\temp\.
I'll report back findings.
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#4
2011-11-29, 04:43 PM
I've also seen reports that you should use the ip address of the NAS rather than the name in the unc path (i.e. \\192.168.1.10\share).

I believe mvallevand has written a network drive helper utility that will help here as well, but I don't remember what it's called.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
NebulaOdyssey
Offline

Junior Member

Posts: 11
Threads: 2
Joined: Nov 2011
#5
2011-11-29, 05:50 PM
Hmm.. Still no luck with this. Here is my part of my .bat and at the moment I'm just doing a mkdir to see if write access works.

I get no folder in my NAS directory when NPVR calls it after a recording. But I get both folder created if I run the .bat myself. Any more thoughts?:confused:

set savepth="\\DiskStation\recorded tv\"
set savepath="\\192.168.1.80\recorded tv\"

mkdir %savepth%"helloNAME"
mkdir %savepath%"helloIP"
NebulaOdyssey
Offline

Junior Member

Posts: 11
Threads: 2
Joined: Nov 2011
#6
2011-11-29, 06:13 PM
I'v just tried it but changed one of the savepaths to my <C:\temp\> and it created the folder for me after a recording.

Thinking about it; if the .bat is run under a different user by NPVR (hence won't recognise R:\) then there will also be a permission issue when using either <\\ComputerName\share\> or <\\192.168.1.2\share\> because only certain users have access (read-write) to that NAS shared folder. Assuming this is the problem, how might I resolve without allowing guest access to this folder?

Many Thanks
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#7
2011-11-29, 07:35 PM
NebulaOdyssey Wrote:I'v just tried it but changed one of the savepaths to my <C:\temp\> and it created the folder for me after a recording.

Thinking about it; if the .bat is run under a different user by NPVR (hence won't recognise R:\) then there will also be a permission issue when using either <\\ComputerName\share\> or <\\192.168.1.2\share\> because only certain users have access (read-write) to that NAS shared folder. Assuming this is the problem, how might I resolve without allowing guest access to this folder?

Many Thanks
You could try running the NPVR Recording Service as your own user (run Services.msc and change the properties), I guess it should not prevent the recording service to do its job provided you have administrator privilegies.

"I'd rather have a bottle in front of me than a frontal lobotomy"
NebulaOdyssey
Offline

Junior Member

Posts: 11
Threads: 2
Joined: Nov 2011
#8
2011-11-29, 08:19 PM
Reddwarf Wrote:You could try running the NPVR Recording Service as your own user (run Services.msc and change the properties), I guess it should not prevent the recording service to do its job provided you have administrator privilegies.

Reddwarf, good idea I'd never have thought of that. I didn't even know you could do that in Windows.
The score is, I just tried it, and while it sort of worked (I had a recording already scheduled, and the .bat did make a directory [only if I did a "net use" to define my mapped drive]) for new recordings this causes NPVR to crash if I use the tv guide to scheduled any new recording.

So this won't work in the long run as I can't schedule recording now.

fiy to all I tried the following also to no avail.

net use /persistent:yes w: "\\192.168.1.2\share" /U:user password
mkdir "w:\test"
net use w: \delete

(the idea was to make the map drive under the current user running the .bat (with correct user and pass for the \share), make a directory, then disconnect the map.)[didn't work for me]

Any more ideas. Thanks for the ones so far, they have been very good tries; just not quite there yet.
NebulaOdyssey
Offline

Junior Member

Posts: 11
Threads: 2
Joined: Nov 2011
#9
2011-11-29, 09:16 PM
Hi all,

Okay Reddwarf I've managed to get your amazing idea to work. As I said it made NPVR crash (even when I restated NPVR Recording Service) in tv guide. However a simple reboot rectified this. Note I was unable to use any currently mapped drives for some reason so I just map the share to a letter I'll not use otherwise and then disconnect it when done. The only problem with this method is that you have to store the username and password in your .bat (or a .exe. file using bat-to-exe) in plain text [not a great option]. More options welcome but I'll share a working solution below.

In services.msc change the logon user of "NPVR Recording Service" to one with adequate admin permissions and use the following in the postprocessing.bat

net use /persistent:yes w: "\\ip to share drive\share folder" /U:username password
copy %1 "W:\some folder\"
net use w: \delete

I hope this may help others. I'm still looking for a better alternative (don't like the plain text username and password) but will use the above method in the meantime. Thanks Reddwarf
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#10
2011-11-29, 10:16 PM
Well, that's a workaround, at least Smile

"I'd rather have a bottle in front of me than a frontal lobotomy"
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  incorrect frequency in adelaide .ini file spin35 5 3,020 2023-02-01, 05:40 PM
Last Post: sub
  HDHomerun recording bizzarely not working Jean0987654321 3 2,033 2021-03-27, 03:23 PM
Last Post: Jean0987654321
  ts file shows length too long? SuttonWillow 2 1,905 2021-03-15, 01:56 PM
Last Post: mvallevand
  Unhandled Exception: file name too long (idiots at pbs made it super long) jobby99 1 1,396 2020-10-29, 09:40 PM
Last Post: mvallevand
  ts file shows length too long SamM 4 2,329 2020-10-06, 02:45 AM
Last Post: Ehrlichia
  EPG displaying small subset of xmltv file. Esteban 9 3,010 2020-07-18, 10:07 PM
Last Post: Esteban
  Max File Size jrockow 2 1,518 2020-04-21, 02:38 PM
Last Post: jrockow
  Channels/PIP popups not working 4.2.5 (191014) eastavin 7 2,804 2020-04-20, 03:20 AM
Last Post: eastavin
  Absolute Newbie OTA EPG not working as expected. n8lbv 4 2,599 2020-04-02, 06:03 PM
Last Post: mvallevand
  Import recorded tv shows to NPVR mattman1968 9 5,974 2020-03-03, 12:57 PM
Last Post: Jimixter

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode