Backup

Home Forums Scripting General Scripting Backup

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    Andy_m
    Member
    #143502

    Whats the best way of putting this batch file on user machines, All machines in a group have their own mapped drives on X drive.

    My question is whats best way to run this batch file? and if I need any modifacations to this code? I would like to perform this script once a week or may be twice?


    @echo
    off
    set drive=X:
    set backupcmd=xcopy /s /c /d /e /h /i /r /y
    echo ### Clearing previous backup…
    del /s /q %drive%
    echo Previous backup now removed

    cls
    echo ### Backing up My Documents…
    %backupcmd% “%USERPROFILE%My Documents” “%drive%My Documents”
    echo ### Backing up Favorites…
    %backupcmd% “%USERPROFILE%Favorites” “%drive%Favorites”
    echo ### Backing up email and contacts (MS Outlook)…
    %backupcmd% “%USERPROFILE%Local SettingsApplication DataMicrosoftOutlook” “%drive%Outlook”
    echo ### Backing up Desktop…
    %backupcmd% “%USERPROFILE%Desktop” “%drive%Desktop”
    echo ### Backing up the Registry…
    if not exist “%drive%Registry” mkdir “%drive%Registry”
    if exist “%drive%Registryregbackup.reg” del “%drive%Registryregbackup.reg”
    regedit /e “%drive%Registryregbackup.reg”
    echo Backup Complete![/CODE][CODE]@echo off
    set drive=X:
    set backupcmd=xcopy /s /c /d /e /h /i /r /y
    echo ### Clearing previous backup…
    del /s /q %drive%
    echo Previous backup now removed

    cls
    echo ### Backing up My Documents…
    %backupcmd% “%USERPROFILE%My Documents” “%drive%My Documents”
    echo ### Backing up Favorites…
    %backupcmd% “%USERPROFILE%Favorites” “%drive%Favorites”
    echo ### Backing up email and contacts (MS Outlook)…
    %backupcmd% “%USERPROFILE%Local SettingsApplication DataMicrosoftOutlook” “%drive%Outlook”
    echo ### Backing up Desktop…
    %backupcmd% “%USERPROFILE%Desktop” “%drive%Desktop”
    echo ### Backing up the Registry…
    if not exist “%drive%Registry” mkdir “%drive%Registry”
    if exist “%drive%Registryregbackup.reg” del “%drive%Registryregbackup.reg”
    regedit /e “%drive%Registryregbackup.reg”
    echo Backup Complete![/CODE]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.