- November 8, 2012
- 4
- 0
- Home Country
- Denmark
I've created a little batch script, which might be helpfull for others:
I record TV to c:\rec_tv
Recordings are moved to \\nas\rec_tv
in c:\rec_tv\ I've created a empty text file, named dont_delete.txt. If I do not have this file, robocopy will delete my c:\rec_tv folder when done moving recorded TV.
This I perform every morning and I automatically update my MySQL DB with correct entries to my NAS.
I record TV to c:\rec_tv
Recordings are moved to \\nas\rec_tv
in c:\rec_tv\ I've created a empty text file, named dont_delete.txt. If I do not have this file, robocopy will delete my c:\rec_tv folder when done moving recorded TV.
This I perform every morning and I automatically update my MySQL DB with correct entries to my NAS.
Code:
robocopy c:\rec_tv\ \\NAS\rec_tv /E /MOVE /XF dont_delete.txt
cd "c:\Program Files\MySQL\MySQL Server 5.1\bin"
mysql -uroot -pMediaPortal mptvdb -e "UPDATE recording SET fileName=replace(fileName,'C:\\rec_tv\\', '\\\\nas\\rec_tv\\') WHERE fileName LIKE 'C:%';"