Backup on Windows

From ITSwiki
Revision as of 10:55, 3 July 2013 by Prhogg (Talk | contribs)


Jump to: navigation, search

This howto describes how to back up data stored locally on Windows PC's (desk- and laptops).

For a description of the general principles and ideas about the DTU Compute back up program please refer to this link.

For a description of the general backup concepts please refer to this link.

The information found on this page is specific for windows pc's. Linux, Mac or other *NIX PC users should refer to the 'rzyncbackup' guide found here.

General information about the DTU Compute backup program

This backup program is run the first time each day a Windows user logs on to the Windows domain. Therefore remember to logout when you leave DTU Compute. DTU Compute backup may also be run on demand. For this setup please contact ITSupport

The program is especially useful for Notebook users that can not use our file servers for general storage of data, but need local copies when they are outside DTU Compute.

Customization

As default the backup program uses a server side initialisation file for defining the files and directories to backup. The program can be customized to special needs by copying this

Technique

The backup is using Robocopy for creating a server side copy of your local data. This server side copy is always online and is included in the nightly backup to tape. Robocopy is a Microsoft utility that can synchronize files and directories. The synchronization method is used in order to only copy data that has changed since the last backup.

To check what has been backed up

The files are backup to the share \\nas1.imm.dtu.dk\backups under username -> machine name . The structure is rather self-explaining.

Note: please do not manually write to this share - files here should only be written by the immbackup utility.

How to

NB: Throughout this section we refer to localusername which is the logon name on the local PC; type echo %username% in a command prompt to obtain it.

...make sure that a backup is performed

For users is logging on to an WIN domain account

Whenever the user log on to the PC/notebook and the PC is attached to the DTU Compute network immbackup will be executed. However, if the user already logged on earlier the same day no backup will be performed, i.e. at most one backup per day. If an extra backup is desired, run immbackup.exe manually without any arguments.

User is not logging on to an WIN domain account

  1. First create a folder c:\util\localusername.
  2. Copy the \\nas1.imm.dtu.dk\util\immbackupwrapper.exe to:
     %userprofile%\Start Menu\Programs\Startup
    (Windows XP)
    C:\Users\[localusername]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup (Windows 7)
  3. Copy the \\nas1.imm.dtu.dk\util\immbackupwrapper.ini to C:\util\localusername\ and rename it to immbackup.ini and edit it according to needs.
  4. Whenever the user is logging on he will get the option of performing a backup. Additional backup can be performed by running immbackupwrapper.exe manually.

...add folders to the backup set.

robocopy sessions

If c:\util\localusername\immbackup.ini does not exists copy \\nas1.imm.dtu.dk\util\immbackup.ini to
c:\util\localusername\immbackup.ini.

Edit the sections [robocopyfolders2include], [robocopyfolders2exclude] and [robocopyfiles2exclude] according to need.

...restore files which have been backed up.

From a robocopy session

Look for the files under \\nas1.imm.dtu.dk\Backups\username\pcname\robocopy\driveletter\...


If the files are not there (because the desired file(s) is not from the most the recent robocopy session) you might find it using snapshots: look for the folder \\nas1.imm.dtu.dk\Backups\username\pcname\robocopy\~snapshot and go to the folder nightly.0 for how it looked last midnight, nightly.1 2 nights ago, etc. For older versions than one week, please contact ITSupport which will then restore from tape. Describe which files/folders and from which day.

More Background Information

Robocopy sessions

Keywords; will simply maintain a one to one copy of the folders selected on the network share. Always have the latest copy of the files of interest in the backup share - simplified version control is obtained by placing a copy of the network share on tapes and rotating these tapes on a up to 3 months cycle.


Configuration

There is only one file to do configuration in; c:\util\localusername\immbackup.ini holds both

settings for immbackup and immbackupwrapper. The complete list of supported settings is

; Sample c:\util\%username%\immbackup.ini file

; Copy this file to c:util\%username% and edit it

; as needed.
 ; This file show all the supported settings for both immbackup
 ; and immbackupwrapper.
 ;
 ; hc 20100825


 ; This section is only read by the immbackupwrapper program
 ; If the immbackupwrapper program is used both "immbackup"
 ; and "backuppath" must be specified while "authusername"
 ; is optional.
[wrapper]
immbackup=\\nas1.imm.dtu.dk\util\immbackup.exe
backuppath=\\nas1.imm.dtu.dk\Backups\%username%\%computername%
authusername=%username%

 ; This is only read by the immbackup and the values given below
 ; is the defaults if not specified.
[setup]
 ;backuppath=\\nas1.imm.dtu.dk\Backups\%username%\%computername%

 ;robocopypath=\\nas1.imm.dtu.dk\util\robocopy.exe
 ;runmanualonly=0
 ;userobocopy=1
 ;lookforunwantedprocesses=0


 ; List of folders to be included in the robocopy backup program.
 ; Acceptable environment variables are
 ; %username% %userprofile% %computername%
 ;
 ; Generally, it is not important what is in front of the "="
 ; (i.e. "dir1", "dir2", "file1", etc.)

[robocopyfolders2include]
dir1=c:\%username%
dir2=%userprofile%\favorites\
dir3=%userprofile%\desktop\
dir4=c:\util\%username%
dir5=d:\work

 ; List of files to exclude. Only if they are a sub-folder
 ; of a directory to be include will they be considered
[robocopyfolders2exclude]
dir1=c:\%username%\temp

 ; List of files to be excluded. Only if they are a file within
 ; a folder to be included will they be considered.
[robocopyfiles2exclude]
file1=c:\%username%\program output\huge temp file.log

Note; lookforunwantedprocesses simply check for a hardcoded list of programs which is known to
use file locking. If a program is running a pop up windows occurs and the user must prompt "OK"
to continue. The list of programs includes (for immbackup.exe version 2.0.12); outlook.exe,
thunderbird.exe, thunde~1.exe, mozilla.exe and msimn.exe (aka Outlook Express).

Removal of old backups:

Based on the information in \\nas1.imm.dtu.dk\backups\username\machine_name\immbackupdate.txt old backup sets will
be removed automatically. Once a backup is more than 3 month old it will be removed from the
backup share and archived to tape.

Command line arguments:

Immbackup.exe accepts the following command line arguments:


-1 Check if backup has been performed already today. Abort if yes.
-m Check if runmanual is set to "1" in inifile. Abort if yes.

-h Show version and usage info.
-q Don't copy logfile(s) to c:\util\....
-v Show additional debugging info.

Immbackupwrapper.exe only takes one argument:
-h Show version and usage info.

Files:

\\nas1.imm.dtu.dk\util\immbackup.exe
The main backup program. Type "immbackup.exe -h" for further usage info.

C:\util\localusername\immbackup.ini
This file is the configuration file for both immbackupwrapper and immbackup

C:\Documents and Settings\localusername\Start Menu\Programs\Startup\immbackupwrapper.exe
Test whether backup should be performed and takes care of authentication to network fileserver and finally calls immbackup.exe

\\nas1.imm.dtu.dk\Backups\username\pc_name\immbackup.log
Immbackup logs various errors etc. to this file

\\nas1.imm.dtu.dk\Backups\username\pc_name\immbackupdate.txt
Immbackup logs time stamps for robocopy sessions to this file

\\nas1.imm.dtu.dk\Backups\username\pc_name\robocopy
Default location where backup files is located for robocopy sessions


\\nas1.imm.dtu.dk\util\immbackupdefault.ini
Default configuration file if C:\util\%username%\immbackup.ini is not found

C:\util\%username%\immbackup.ini
Local configuration file for immbackup and immbackupwrapper.