This is just a simple windows batch file so I don't think license applies, but just to be clear - it's freely available. Use and adapt at will. I think we all build our batch files by adaptation anyway! It's not very big but I tend to document my batch files as though I will have forgotten everything I know by the next time I use it (which has happened), and I've left all those remarks in place.
I call it xcopy-nfos.bat. I also use a PAUSE at the end so the command window stays open until I can check my results if I'm not outputting to a log. My TV Shows are split into folders called Lib1, Lib2, etc. One would need to adjust for one's own situation. I actually have this split into 2 batches since my folders are on 2 systems, but I combined it here to illustrate. I'm running this on WinXP and Win8.
Code:
@echo off
REM
REM Create a folder for storing your backed up nfo's - this should be
REM outside of XBMC's folders. When the batch is run it will set a
REM variable to yyyy.mm.dd using the current date and this variable
REM will be used to copy the nfo files into a dated subfolder.
REM
REM For network shares, this should be run on the system that actually
REM hosts the share, otherwise it will be very slow.
REM
SET BackupDate=%Date:~10,4%.%Date:~4,2%.%Date:~7,2%
ECHO.
ECHO -------------------------------------------------------
ECHO Copying *.nfo's from XBMC Library folders
xcopy "D:\Movies\*.nfo" "C:\nfo_backups\%BackupDate%\Movies\" /c /s /r /y /i /f /e
xcopy "E:\Lib1\*.nfo" "C:\nfo_backups\%BackupDate%\Lib1\" /c /s /r /y /i /f /e
xcopy "F:\Lib2\*.nfo" "C:\nfo_backups\%BackupDate%\Lib2\" /c /s /r /y /i /f /e
xcopy "G:\Lib3\*.nfo" "C:\nfo_backups\%BackupDate%\Lib3\" /c /s /r /y /i /f /e
ECHO.
ECHO -------------------------------------------------------
ECHO All transfers complete
PAUSE
EXIT
REM
REM command: xcopy "source\*.*" "destination\" /c /s /r /y /i /f /e > c:\logs\xcopy.log
REM
REM xcopy switches:
REM /c ignore errors
REM /s copy dirs and subdirs
REM /r copy read-only files
REM /y overwrite files
REM /i create new folders at destination
REM /f display full file name
REM /e copy empty directories
REM
BTW, if you happen to mis-type *.nfo as *.mfo it will completely replicate your folder structure but with empty folders.
PatK, that's a great idea about just copying the userdata folder, but I'm not sure it would work for me since I'm using a MySQL database. I've read that MySQL can be fussy about just plopping the files back in place? I agree with the philosophy of letting xbmc do as much as possible but I'm ready to add home movies and I don't want to have to do all that manually. Lazy, I know...
Just an aside: I started using xcopy in batch when I was copying music to a thumb drive for use on a dumb device. Windows drag-n-drop actually copies in reverse and that device was too dumb to do file management so all my music was listed in the order it was written. Drove me crazy, so I did something about it and in the process discovered that xcopy in batch is much faster than drag-n-drop (IMHO). For really big jobs I'll use something that can generate a folder listing that can be exported, plop that into Excel for some quick manipulation and to add columns of static text to build my command lines, then copy it to an editor for some quick global substitutions and save the file. Sounds more complicated than it is! In the end you gain folder-level granularity without having to do it folder-by-folder or line-by-line. I recently had to move my library files off a dying htpc and split them across 2 living systems, and I wanted to divide them up into complete and still-growing, which required show/folder level control. It worked very well and took much less time than I'd thought it would.