2006-12-14, 10:58 AM
i recently made a batch to "archive" shows to a new location and adjust the database to reflect it, so all info is retained..
and added some batch file copy bits, and a profile to allow 'archiving' from the video library...
archive.bat:
profile:
place archive.bat in gbpvr\third party\ dir and adjust profile in config.xml to reflect your needs..
i'll probably make an installer soon..will make a nice n simple conflict-free archiving solution...
[so you can use multiple drives to store files and offload main rec drive seamlessly!]
Enjoy...
Code:
sqlite3.exe -separator "," "%db%" "UPDATE RECORDING_SCHEDULE SET filename = 'z:\newlocation\show1.mpg' where filename like 'show1.mpg';"
archive.bat:
Code:
@echo off
echo starting from %cd% >archive.log
echo %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 >>archive.log
set db=GBPVR.DB3
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
echo oid = %oid% >>archive.log
if "%oid%" EQU "" (
echo. >>archive.log
echo ******** That file is not in GBPVR database! >>archive.log
goto :eof
)
echo. >>archive.log
if not exist "%~dp2" md "%~dp2"
copy "%~1" "%~2"
echo copyerrors = %errorlevel% >>archive.log
if not errorlevel 1 (
echo running sqlite >>archive.log
sqlite3.exe -separator "," "%db%" "UPDATE RECORDING_SCHEDULE SET filename = '%~2%~nx1' where filename like '%~1';"
del "%~f1" 2>NUL
) else (
echo Copy problem! >>archive.log
)
echo Done. >>archive.log
ECHO. >>archive.log
ECHO. >>archive.log
goto :eof
profile:
Code:
<Conversion name="Archive to k" exe="archive.bat" cmd=" {SOURCE_FILE} z:\newlocation\archive\ " targetExtension=".avi" />
place archive.bat in gbpvr\third party\ dir and adjust profile in config.xml to reflect your needs..
i'll probably make an installer soon..will make a nice n simple conflict-free archiving solution...
[so you can use multiple drives to store files and offload main rec drive seamlessly!]
Enjoy...
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie