NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 … 3 4 5 6 7 … 56 Next »
SuperSimpleArchiver

 
  • 0 Vote(s) - 0 Average
SuperSimpleArchiver
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#1
2007-05-17, 10:16 PM (This post was last modified: 2010-01-03, 09:31 PM by pBS.)
Offload your shows to another drive! Even another machine...
Here's a tiny little archiver function i made to move your videos to another location and automatically adjust the database to reflect the new location..Smile
NEW: it also creates the subdir for recordings for better organization..
It consists of just a batch file and sqlite3.exe...

First, you need to download the zip and extract the reloc.bat to your gbpvr\Third Party\ directory, and sqlite3.exe to gbpvr\ if you don't already have one there..

Then, add a profile to custom ffmpeg conversions section in config.xml with your destination dir like:
Code:
<Conversion name="[b][color=Red]Archive to USB[/color][/b]" exe="reloc.bat" cmd=" {SOURCE_FILE} [b]&quot;[color=RoyalBlue]\\homepc\kdrv\mpg\archive\[/color]&quot;[/b]  &gt;&gt;archiver.txt" targetExtension=".mov" />
Note: "&quot;" = double quotes ["] and "&gt;" = greater than [>] when used inside strings in config.xml
Replace "Archive to USB" with whatever you wish to call the profile. [Will appear as profile name in video library]
Replace "\\home\k\mpg\archive\" with your destination dir. [Either network path or local, must end with \]

Create a profile for each destination you wish to use, you can even make one to restore them to recordings dir as well..Smile
I set up 2 drives, and a restore to original location profiles for myself..
[to setup a restore profile, just set regular recordings dir as destination]

To Use:
Go into Video Library and select file to archive, hit left arrow to get to menu on left, select "Transcode" and move down to select your archive profile and hit "start" and either wait,or hit "Close" and it will continue in background.
If you hit "Close", it will let you do other things in GBPVR while it runs, if you hit Stop, it will stop the process completely...

It will copy the file to new location, [it takes a while] then adjust the database to new location, then delete old file..

When you go back into Recordings screen, the file will still play and show all info as if nothing happened..[but notice all the new free space!Big Grin]

**Just to be safe, turn off the 'AutoRemoveMissingRecordings' in config first..**
works fine for me without it because it copies, adjusts database, then deletes..but setting usefull
for those with removable USB drives..

Works with renamed files, and across network drives [\\server\drive\]

******UPDATE:
Now copies and deletes all files with same first name and extension .txt, .srt, .edl
Also removes old souce dir if no movies inside..
******Fixed:
oops, forgot a closing ")" at end of file after changes...fixed..

May 6 '08 Removed attrib.exe checks as some people don't have this installed and wasn't really needed anyways..
Also changed to not delete if there's a folder.* in the dir to save folder.jpgs and .pngs..
[COLOR="Red"] Changed Profiles! now needs a \ at end of dest. path
Adjust your profiles in config.xml accordingly if upgrading[/COLOR]
Added cmd-line help Big Grin
[COLOR="Red"]Sept 15 08: added .ts to list of movies..
set default to not delete source dir [see end of file for 'set deldir=no' set to yes and it will cleanup empty source dirs][/COLOR]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#2
2007-05-17, 10:19 PM
it will also create a log as gbpvr\archiver.txt and a list of archived files in gbpvr\archived.txt
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#3
2007-05-17, 11:43 PM (This post was last modified: 2008-12-26, 08:17 AM by pBS.)
it can be used from command-line also, so can be used from batch scripts, say like in an auto-firing gbpvr bat..[postprocessing.bat,etc] or scheduled nightly..

usage:
"reloc.bat drive:\path\filename.mpg drive:\path\"
.............[---------file-----------][destination]
use start /wait reloc.bat etc. in batch files...
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
moymike
Offline

Member

Posts: 75
Threads: 15
Joined: Nov 2006
#4
2007-05-19, 02:43 PM
I wish I could do this sort of thing from "Recordings". I like to keep the last one or two episodes of shows I record. I watch with MVP, so it means I have to move files manually on the computer.

I guess I could move the recordings directory to be a subdirectory under the video library... worth a thought. If your batch file could do a move versus a copy, will have to check that out.
HtV
Offline

Posting Freak

Posts: 3,470
Threads: 46
Joined: Dec 2005
#5
2007-05-19, 02:59 PM
You could just add the rec-dir to the list of dirs in the video-library-dirs screen in config-directories. I don't know if it'll keep the recordings-info?:eek:
You could try with a test recordingBig Grin
AMD Athlon 64 3000, HDD: 80, 120, 200 GB, Hauppauge 350 + 150, MVP, Asus 6000L Laptop client, Asus X50sl client,
Fritz!box 7140 modem/router, GBPVR 1.3.7.
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#6
2007-05-22, 02:29 AM (This post was last modified: 2007-05-22, 02:49 AM by pBS.)
no problem, you use it from video library, but it adjusts the recordings screen info..
files with no info in database are just moved..
yea, i wish it were built into recordings screen, but this ain't that bad..

and it Does do a move, kinda...it copies, then deletes original..but i don't delete it before the database is adjusted, so DB won't throw out the info...
so if you move one, you'll notice no difference in Recordings screen, but the file will be moved in video library, [the actual file].

just add your recordings dir to the video library, it really does come in handy..
and multiple profiles means you can have several drives to offload your stuff to..Big Grin just make profiles in config for each destination..
you could automate it from a batch file that tests ages of shows or space left and moves accordingly..
works with MVP as well...

and all your shows will still show up in Recordings screen as if nothing's happened..Smile
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#7
2007-07-22, 09:01 AM (This post was last modified: 2008-10-08, 05:50 AM by pBS.)
[SIZE="3"]UPDATED[/SIZE]
i made this little mod to archive a whole series[directory] of shows at once..Big Grin

remember to place .bat in "gbpvr\third party\" and add new profile and this batch..
Code:
@echo off
:: cls
echo ********* >>"third party\archiver.log"

set db=GBPVR.DB3

for /f "tokens=1,2,3,4,5,6,7,8,9,10 delims=\" %%d in ("%~dp1") do (
    if not "%%d"=="" set filedir=%%d
    if not "%%e"=="" set filedir=%%e
    if not "%%f"=="" set filedir=%%f
    if not "%%g"=="" set filedir=%%g
    if not "%%h"=="" set filedir=%%h
    if not "%%i"=="" set filedir=%%i
    if not "%%j"=="" set filedir=%%j
    if not "%%k"=="" set filedir=%%k
    if not "%%l"=="" set filedir=%%l
    if not "%%m"=="" set filedir=%%m
)

echo Subdir is %filedir%

for %%d in ("%~dp1*.mpg" "%~dp1*.avi" "%~dp1*.wmv" "%~dp1*.ts" "%~dp1*.dvr-ms" ) do (
call :adjust "%%d" "%~2"
)
goto :eof

:adjust
echo %1
set oid=
for /f "usebackq tokens=1,2 delims=," %%v in (`sqlite3 "%db%" "SELECT programme_oid FROM recording_schedule where filename like '%%%~nx1'; " `) do set oid=%%v
if "%oid%" EQU "" (
echo.
echo ******** That file is not in GBPVR database!
rem goto :eof
) else (echo Found in GBPVR database! )


echo.
if not exist "%~2%filedir%\" md "%~2%filedir%\"
copy /Y "%~dpn1.*" "%~2%filedir%\"

if not errorlevel 1 (
echo running sqlite >>"third party\archiver.log"
sqlite3.exe -separator "," "%db%" "UPDATE RECORDING_SCHEDULE SET filename ='%~2\%filedir%\%~nx1' where filename like '%%%~nx1';"
  del /q "%~dpn1.*"
) else (
echo errors = %errorlevel% >>"third party\archiver.log"
echo Copy problem!
)

echo Done.
echo %date% %time% Copied "%~dpn1.*"  to  %2  >>"third party\archived.txt"
goto :eof
[save as relocdir.bat]

sample profile: [adjust for your needs]
Code:
<Conversion name="Archive ENTIRE directory" exe="relocdir.bat" cmd=" {SOURCE_FILE} \\home\g\mpg\ &gt;&gt;archives.txt" targetExtension=".mov" />
[SIZE="3"]Updated to handle .avi .wmv .ts and .dvr-ms too Smile[/SIZE]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#8
2007-07-22, 10:17 AM
This is totally cool. Smile I've been wishing for something exactly like this ever since I first installed GB-PVR. Can't wait to try it.

Re: having your recordings directory defined as a Video Library folder. You kinda have to do this if you want to use the built in transcoding feature at all so this should be standard procedure for anyone who is already trying to save disk space by transcoding.

I'm assuming, since it copies all files with the same file name, that it would pick up any .avi files that have been trancoded from an existing mpeg recording.

What would be icing on the cake would be an option to transcode at the same time as moving the recording. ie. transcode the file (to Xvid, Divx, whatever) putting the new avi file on the target drive, then adjust the sqlite row to point to the new avi in the new location, then delete the old mpeg.
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#9
2007-07-22, 10:26 AM
yea, it'll move the avi, but not adjust the database for it...[just the mpeg file]
but it shouldn't be hard to mod it for that also..just add another sqlite line for avi stuff...Smile

and yes, the same principals can be used to do exactly that, just replace the 'copy' line with an encode line outputting to proper dir and you're all set..Smile
the batch params are kinda creative so may not be easy for average-user..
but it should be easy enough for most GBPVR'ers Big Grin
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#10
2007-07-22, 11:30 AM
Yeah, I see what you mean. The batch file is easily modified to do any permutation you like.

And, presumably, one could have several versions (or add some parms to switch its behaviour) and add a <Conversion name=xxx line for each one.

Am I right in thinking that targetExtension=".mov" in the <Conversion entry is not actually being referenced and is just there because GB-PVR expects to see something at that location?
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
« Next Oldest | Next Newest »

Users browsing this thread: 3 Guest(s)

Pages (19): 1 2 3 4 5 … 19 Next »
Jump to page 


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

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

Linear Mode
Threaded Mode