Tuesday, November 14, 2006

 

Backup preferences

I use windows and Mac OS X. Most of the applications I use are multiplatform. I save/backup the preferences of these applications in a thumb drive.
Here is the batch file which does that; you can write a shell script based on this.

Batch file backup_my_preferences.bat


rem Mar 06, 2006 10:35 AM
rem This will backup my prefences to a thumb drive
rem
rem TODO use rysnc instead of copy
rem
rem $1 is the drive name provided by totalcommander or as a parameter from command line
rem
rem firefox
IF EXIST "%1\backup" GOTO havebackup
mkdir %1\backup
:havebackup
IF NOT EXIST "%1\backup\firefox" mkdir %1\backup\firefox
@rem echo /v /y "c:\Documents and Settings\name.com\ApplicationData\Mozilla\Firefox\Profiles\i53v54ql.default\bookmarks.html" %1\backup\firefox\
copy /v /y "c:\Documents and Settings\name.com\ApplicationData\Mozilla\Firefox\Profiles\i53v54ql.default\bookmarks.html" %1\backup\firefox\

rem googleearth
IF NOT EXIST "%1\backup\GoogleEarth" mkdir %1\backup\GoogleEarth
copy /v /y "c:\Documents and Settings\name.com\ApplicationData\Google\GoogleEarth\*.*" %1\backup\GoogleEarth\

rem itunes
IF NOT EXIST "%1\backup\itunes" mkdir %1\backup\itunes
copy /v /y "c:\Documents and Settings\name.com\My Documents\My Music\iTunes\*.*" %1\backup\itunes\

rem KeepPass database
IF NOT EXIST "%1\backup\keepass" mkdir %1\backup\keepass
copy /v /y "c:\usr\shankar\doc\Database.kdb" %1\backup\keepass\

rem vim
IF NOT EXIST "%1\backup\vim" mkdir %1\backup\vim
copy /v /y "c:\vim\_vimrc_shankar" %1\backup\vim\
copy /v /y "c:\vim\_vimrc" %1\backup\vim\

rem bash
IF NOT EXIST "%1\backup\bash" mkdir %1\backup\bash
copy /v /y "c:\usr\shankar\.profile" %1\backup\bash\
copy /v /y "c:\usr\shankar\_bashrc" %1\backup\bash\
copy /v /y "c:\usr\shankar\.bashrc" %1\backup\bash\
copy /v /y "c:\usr\shankar\.inputrc" %1\backup\bash\
copy /v /y "c:\usr\shankar\_inputrc" %1\backup\bash\
copy /v /y "c:\usr\shankar\.wgetrc" %1\backup\bash\
copy /v /y "c:\usr\shankar\.gdbinit" %1\backup\bash\

copy /v /y "c:\usr\shankar\README-doxygen" %1\backup\bash\
copy /v /y "c:\usr\shankar\config.doxy" %1\backup\bash\
copy /v /y "c:\usr\shankar\.astylerc" %1\backup\bash\

rem freemind
IF NOT EXIST "%1\backup\freemind" mkdir %1\backup\freemind
xcopy /s /y "c:\usr\shankar\freemind" %1\backup\freemind\

rem Stellarium
IF NOT EXIST "%1\backup\stellarium" mkdir %1\backup\stellarium
copy /v /y "c:\Program Files\utils\Stellarium\config\config.ini" %1\backup\stellarium\
:endd



To run this in a DOS Window
c:\usr\shankar>backup_my_preferences g:

Where g: is the thumb drive. I have assigned a button to this batch file in Totalcommander.

Labels:


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?