20111125

Scripting: copiando datos a la red - Scripting: backup your data to the network

Tengo dicho una y mil veces a los $lusers de mi organización, que guarden en la red aquellos emails que puedan echar de menos en caso de pérdida. Sí, lo śe, pero me niego a hacer backup de toda la basura que envían y reciben. No somos Google ni mucho menos, así que ¿para que hacer copia de tal cantidad de mie_da?
La cosa es que pedirles que hagan copia de sus favoritos y su libreta de direcciones quizás sea demasiado, así que, teniendo en cuenta que principalmente usan Internet Explorer y Mozilla Firefox para guarri-navegar por la red de redes, y Mozilla Thunderbird como cliente de correo corporativo, he añadido el siguiente script al de logon de Active Directory, con el que copio los archivos a su unidad de usuario de red:
@ECHO OFF
SET BACKUP_DIR=u:\backup
REM Creación de directorios
IF NOT EXIST %BACKUP_DIR% MKDIR %BACKUP_DIR%
IF NOT EXIST %BACKUP_DIR%\ie mkdir %BACKUP_DIR%\ie
IF NOT EXIST %BACKUP_DIR%\ffox mkdir %BACKUP_DIR%\ffox
IF NOT EXIST %BACKUP_DIR%\tbird mkdir %BACKUP_DIR%\tbird
ATTRIB +H %BACKUP_DIR%

REM Backup favoritos de IE
xcopy /q /e /y "%USERPROFILE%\Favoritos" %BACKUP_DIR%\ie\ > NUL
REM Backup marcadores de Firefox
FOR /f "tokens=1 delims=(=" %%G IN ('dir /s/b/a  "%APPDATA%\Mozilla\*.sqlite"') DO copy /y "%%G" %BACKUP_DIR%\ffox > NUL
REM Backup libretas de direcciones de Thunderbird
FOR /f "tokens=1 delims=(=" %%G IN ('dir /s/b/a  "%APPDATA%\*.mab"') DO copy "%%G" %BACKUP_DIR%\tbird > NUL

Por si a alguno le sirviese de ayuda!


"Our SAN will never store the rubbish you store in your mail boxes". I've said that once and again to the $lusers of my organization. If once a year the recieve an important mail they have to save it on the network where the backup proccess will protect them from themselves, but to asking them to save their bookmarks and addressbooks is too much! 
Internet Explorer y Mozilla Firefox are the clients the use to browse the web and Mozilla Thunderbird is the mail client we use so I've added the folloging lines to the Active Directory logon script:
@ECHO OFF
SET BACKUP_DIR=u:\backup
REM Making the backup directories
IF NOT EXIST %BACKUP_DIR% MKDIR %BACKUP_DIR%
IF NOT EXIST %BACKUP_DIR%\ie mkdir %BACKUP_DIR%\ie
IF NOT EXIST %BACKUP_DIR%\ffox mkdir %BACKUP_DIR%\ffox
IF NOT EXIST %BACKUP_DIR%\tbird mkdir %BACKUP_DIR%\tbird
ATTRIB +H %BACKUP_DIR%

REM Backup IE favorites
xcopy /q /e /y "%USERPROFILE%\Favorites" %BACKUP_DIR%\ie\ > NUL
REM Backup Firefox bookmarks
FOR /f "tokens=1 delims=(=" %%G IN ('dir /s/b/a  "%APPDATA%\Mozilla\*.sqlite"') DO copy /y "%%G" %BACKUP_DIR%\ffox > NUL
REM Backup Thunderbird addressbook
FOR /f "tokens=1 delims=(=" %%G IN ('dir /s/b/a  "%APPDATA%\*.mab"') DO copy "%%G" %BACKUP_DIR%\tbird > NUL

I hope it helps you!

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.

No hay comentarios: