home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My TVSeries
MP TV Series completely rebuilds database if my server crashes.
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="RoChess" data-source="post: 643032" data-attributes="member: 18896"><p>If it was me, I would worry more on the 'why' my system crashes instead of trying to fight the symptoms.</p><p></p><p>Use a script otherwise to backup your database with a datestamp before you launch MediaPortal, that way you can always go back to any point in time you wish when corruption occurs.</p><p></p><p>The following script is what I use myself:</p><p></p><p>[collapse][code]@Echo Off</p><p>REM Script to backup important files with date/time stamp, before launching MediaPortal.</p><p>REM It also makes sure MediaPortal is not already running.</p><p>REM Last Modified: March 1st 2010</p><p>REM Author: RoChess</p><p></p><p>cls</p><p>echo.</p><p></p><p>SET LogFolder="%ProgramData%\Team MediaPortal\MediaPortal\log\"</p><p>SET DatabaseFolder="%ProgramData%\Team MediaPortal\MediaPortal\database\"</p><p></p><p>SET BackupFolder=%UserProfile%\Desktop\MediaPortal Backups</p><p>SET Zip="C:\Program Files\7-Zip\7z.exe"</p><p>SET Delay=ping 1.1 -n 1 -w 5000</p><p></p><p></p><p>REM --- Check if MediaPortal is still running</p><p>tasklist | find /i /c "MediaPortal.exe" &&goto MediaPortalIsRunning</p><p>tasklist | find /i /c "PluginConfigLoader.exe" &&goto MediaPortalIsRunning</p><p></p><p></p><p>IF NOT EXIST %Zip% (</p><p> echo WARNING: 7-Zip program is required to compress the backup files.</p><p> echo.</p><p> echo Please install it into: %Zip%</p><p> goto ExitDelay</p><p>)</p><p></p><p></p><p>IF NOT EXIST %LogFolder% (</p><p> echo WARNING: MediaPortal.log file can not be found.</p><p> echo.</p><p> echo Please edit this batch file to correct the "LogFolder".</p><p> goto ExitDelay</p><p>) ELSE (</p><p> cd %LogFolder%</p><p> IF EXIST MediaPortal.log (</p><p> REM --- Use log file for stamp info</p><p> FOR /F "eol=[ tokens=1,2" %%x IN (MediaPortal.log) DO (</p><p> SET d=%%x</p><p> SET t=%%y</p><p> goto CreateBackup</p><p> )</p><p> )</p><p>)</p><p>REM --- No log files yet</p><p>goto LaunchMediaPortal</p><p></p><p></p><p>:CreateBackup</p><p> REM --- Create filename stamp</p><p> SET DateStamp=%d%_%t:~0,2%;%t:~3,2%;%t:~6,2%.%t:~9,6%</p><p> IF NOT EXIST "%BackupFolder%" mkdir "%BackupFolder%"</p><p></p><p> REM --- Create actual backup on LOG files</p><p> %Zip% a "%BackupFolder%\Backup.Log (%DateStamp%).7z" *.bak *.log</p><p></p><p> REM --- Cleanup on aisle five for LOG files</p><p> IF EXIST *.bak del *.bak</p><p> del *.log</p><p></p><p> REM --- Create actual backup on DATABASE files</p><p> cd %DatabaseFolder%</p><p> %Zip% a "%BackupFolder%\Backup.Database (%DateStamp%).7z" *.db3</p><p>goto LaunchMediaPortal</p><p></p><p></p><p>:LaunchMediaPortal</p><p> REM --- Locating MediaPortal folder</p><p> IF EXIST "%ProgramFiles%\Team MediaPortal\MediaPortal\MediaPortal.exe" (</p><p> start "MediaPortal" "%ProgramFiles%\Team MediaPortal\MediaPortal\MediaPortal.exe"</p><p> ) ELSE (</p><p> IF EXIST "%ProgramFiles(x86)%\Team MediaPortal\MediaPortal\MediaPortal.exe" (</p><p> start "MediaPortal" "%ProgramFiles(x86)%\Team MediaPortal\MediaPortal\MediaPortal.exe"</p><p> ) ELSE (</p><p> Goto MediaPortalNotFound</p><p> )</p><p> )</p><p>goto EndBat</p><p></p><p></p><p>:MediaPortalIsRunning</p><p> echo WARNING: MediaPortal is still running!!</p><p> echo.</p><p> echo For proper backup files, please close MediaPortal first.</p><p> echo Besides it is dangerous to start it more then once.</p><p>goto ExitDelay</p><p></p><p></p><p>:MediaPortalNotFound</p><p> echo WARNING: MediaPortal *NOT* Found!!</p><p> echo.</p><p> echo Unable to locate MediaPortal in the default location.</p><p> echo Please adjust this script manually to use your custom folder.</p><p>goto ExitDelay</p><p></p><p>:ExitDelay</p><p> echo.</p><p> echo This window will self-destruct in a few seconds.</p><p> echo.</p><p> %Delay% > nul</p><p>goto EndBat</p><p></p><p></p><p>:EndBat</p><p>REM --- All done[/code][/collapse]</p><p></p><p>Enjoy.</p></blockquote><p></p>
[QUOTE="RoChess, post: 643032, member: 18896"] If it was me, I would worry more on the 'why' my system crashes instead of trying to fight the symptoms. Use a script otherwise to backup your database with a datestamp before you launch MediaPortal, that way you can always go back to any point in time you wish when corruption occurs. The following script is what I use myself: [collapse][code]@Echo Off REM Script to backup important files with date/time stamp, before launching MediaPortal. REM It also makes sure MediaPortal is not already running. REM Last Modified: March 1st 2010 REM Author: RoChess cls echo. SET LogFolder="%ProgramData%\Team MediaPortal\MediaPortal\log\" SET DatabaseFolder="%ProgramData%\Team MediaPortal\MediaPortal\database\" SET BackupFolder=%UserProfile%\Desktop\MediaPortal Backups SET Zip="C:\Program Files\7-Zip\7z.exe" SET Delay=ping 1.1 -n 1 -w 5000 REM --- Check if MediaPortal is still running tasklist | find /i /c "MediaPortal.exe" &&goto MediaPortalIsRunning tasklist | find /i /c "PluginConfigLoader.exe" &&goto MediaPortalIsRunning IF NOT EXIST %Zip% ( echo WARNING: 7-Zip program is required to compress the backup files. echo. echo Please install it into: %Zip% goto ExitDelay ) IF NOT EXIST %LogFolder% ( echo WARNING: MediaPortal.log file can not be found. echo. echo Please edit this batch file to correct the "LogFolder". goto ExitDelay ) ELSE ( cd %LogFolder% IF EXIST MediaPortal.log ( REM --- Use log file for stamp info FOR /F "eol=[ tokens=1,2" %%x IN (MediaPortal.log) DO ( SET d=%%x SET t=%%y goto CreateBackup ) ) ) REM --- No log files yet goto LaunchMediaPortal :CreateBackup REM --- Create filename stamp SET DateStamp=%d%_%t:~0,2%;%t:~3,2%;%t:~6,2%.%t:~9,6% IF NOT EXIST "%BackupFolder%" mkdir "%BackupFolder%" REM --- Create actual backup on LOG files %Zip% a "%BackupFolder%\Backup.Log (%DateStamp%).7z" *.bak *.log REM --- Cleanup on aisle five for LOG files IF EXIST *.bak del *.bak del *.log REM --- Create actual backup on DATABASE files cd %DatabaseFolder% %Zip% a "%BackupFolder%\Backup.Database (%DateStamp%).7z" *.db3 goto LaunchMediaPortal :LaunchMediaPortal REM --- Locating MediaPortal folder IF EXIST "%ProgramFiles%\Team MediaPortal\MediaPortal\MediaPortal.exe" ( start "MediaPortal" "%ProgramFiles%\Team MediaPortal\MediaPortal\MediaPortal.exe" ) ELSE ( IF EXIST "%ProgramFiles(x86)%\Team MediaPortal\MediaPortal\MediaPortal.exe" ( start "MediaPortal" "%ProgramFiles(x86)%\Team MediaPortal\MediaPortal\MediaPortal.exe" ) ELSE ( Goto MediaPortalNotFound ) ) goto EndBat :MediaPortalIsRunning echo WARNING: MediaPortal is still running!! echo. echo For proper backup files, please close MediaPortal first. echo Besides it is dangerous to start it more then once. goto ExitDelay :MediaPortalNotFound echo WARNING: MediaPortal *NOT* Found!! echo. echo Unable to locate MediaPortal in the default location. echo Please adjust this script manually to use your custom folder. goto ExitDelay :ExitDelay echo. echo This window will self-destruct in a few seconds. echo. %Delay% > nul goto EndBat :EndBat REM --- All done[/code][/collapse] Enjoy. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My TVSeries
MP TV Series completely rebuilds database if my server crashes.
Contact us
RSS
Top
Bottom