here's a little something i cooked up to delete shows based on age..
just edit to select how many days old you want to keep..
[for GBPVR[pvrx2] only, see 3rd post for Npvr ver]
Auto-delete-old:
it will lookup and delete old files past a certain num days old..
also deletes associated files with different extensions, and cleans up database..
it gets db from registry, and allows a test funstion to query only..
edit the top for the number of days you want to keep, meaning older than chosen days will get deleted..
Requires: sqlite3.exe in gbpvr dir, and this batch file to be placed in gbpvr dir..
add into epgupdate.bat for running on a schedule.. [call delold.bat run]
to run as test to view would-be deleted files, type "delold.bat"
for scripts, to run 'hot' [deletes files], type "delold.bat run"
i recommend running test till you see what you expect to get deleted then a hot run to make sure all is well..it's pretty simple so shouldn't have any issues..
copy and save as delold.bat
any suggestions, additions welcome, it hasn't been tested with regular daily use yet..
just edit to select how many days old you want to keep..
[for GBPVR[pvrx2] only, see 3rd post for Npvr ver]
Auto-delete-old:
it will lookup and delete old files past a certain num days old..
also deletes associated files with different extensions, and cleans up database..
it gets db from registry, and allows a test funstion to query only..
edit the top for the number of days you want to keep, meaning older than chosen days will get deleted..
Requires: sqlite3.exe in gbpvr dir, and this batch file to be placed in gbpvr dir..
add into epgupdate.bat for running on a schedule.. [call delold.bat run]
to run as test to view would-be deleted files, type "delold.bat"
for scripts, to run 'hot' [deletes files], type "delold.bat run"
i recommend running test till you see what you expect to get deleted then a hot run to make sure all is well..it's pretty simple so shouldn't have any issues..
copy and save as delold.bat
Code:
@echo off
:: how many Days old to purge? Older than this will get deleted!
:: Shows must be in database, dates read from database. [file date doesn't matter]
set age=900
:detect gbpvr path and set as db path
for /f "usebackq skip=4 tokens=1,2,3,* " %%e in (`reg query hklm\SOFTWARE\devnz /v "GBPVR InstallDir"`) do set db=%%~hgbpvr.db3
cd /d "%~dp0"
for /f "usebackq tokens=1,2,3 delims=@" %%f in (`sqlite3.exe -separator "@" "%db%" "select manual_start_time, filename from recording_schedule where status = 2 and recording_type = 0 and manual_start_time < date('now','-%age% days') order by manual_start_time;"`) do (
echo.
echo "%%~g"
if "%1" EQU "run" call :delfiles "%%~g"
)
goto :eof
:delfiles
sqlite3.exe "%db%" "delete from recording_schedule where filename like '%~1';"
echo.
del /q "%~dpn1.*"
goto :eof
any suggestions, additions welcome, it hasn't been tested with regular daily use yet..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie