Difference between revisions of "Backup on Windows"

From ITSwiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
m (Text replace - "[[Back up" to "[[Backup")
Line 3: Line 3:
 
For a description of the general principles and ideas about the IMM back up program please refer to this [[Desk- and laptop backup | link]].
 
For a description of the general principles and ideas about the IMM back up program please refer to this [[Desk- and laptop backup | link]].
  
For a description of the general backup concepts please refer to this [[Back up | link]].
+
For a description of the general backup concepts please refer to this [[Backup | 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 [[Back up from Linux | here]].
+
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 [[Backup from Linux | here]].
  
 
==General information about the immbackup program==
 
==General information about the immbackup program==

Revision as of 10:45, 15 June 2012

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 IMM 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 immbackup 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 IMM. IMMbackup 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 IMM.

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. robocopy is the recommended technique and ntbackup is only supported on Windows XP (is not working on Windows 7) and will be removed in a future version.

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 IMM 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\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.

From a ntbackup session:

Somewhat more complicated than using robocopy, but …: Make sure that
c:\util\localusername\immbackup.ini contains (at least) the following lines
[setup]
usentbackup=0
userobocopy=1
ntbackupbksfile=c:\util\localusername\immbackup.bks

Next start the "ntbackup" program, select "Schedule Jobs" and add a new job. Select "Backup selected files, drives, or network data". On the next windows select the foldes/folders you want to backup. In the remaining windows the answers is of no importance except the question of "When to backup". Here you must specify a later time. Close down ntbackup and open explorer and go to "C:\Documents and Settings\localusername\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data". Find the ".bks" file and copy it to c:\util\localusername\immbackup.bks. Finally, go to Start->Control Panel-> Scheduled Task and remove the ntbackup task just created.

...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) please contact ITSupport which will then restore from tape. Describe which files/folders and from which day.

From a ntbackup session

Slightly more tricky. Files are located in \\nas1.imm.dtu.dk\Backups\username\pcname\ntbackup and should be open with ntbackup.exe.

However, if the backup sets present for the current version of the backup file is too new, please contact ITSupport and we will restore from tape (If possible depending on normal tape backup retention policy).

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.

Ntbackup sessions:

By default ntbackup takes a full backup every 5 time it running. However, if immbackup is executed via immbackupwrapper the user will be given the choice every time immbackup is running.

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
;usentbackup=0
 ;runmanualonly=0
 ;userobocopy=1
 ;ntbackupbksfile=c:\util\%username%\immbackup.bks
 ;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 …\username\pc_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. Backup sessions based on either "robocopy" or "ntbackup" is treated separately.

Command line arguments:

Immbackup.exe accepts the following command line arguments:


-t robocopy only run robocopy session - don’t run ntbackup session. If userobocopy
is not specified in the ini file no backup will be performed.
-t ntbackup only run ntbackup session - don’t run robocopy session. If usentbackup
is not specified in the ini file no backup will be performed.
-f Do a full ntbackup but only if usentbackup is specified in ini file.
-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.

-d Do a differential backup but only if usentbackup is specified in ini file.
-h Show version and usage info.
-q Don't copy logfile(s) to c:\util\....
-v Show additional debugging info.
-d and -f option are mutually exclusive.

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 and ntbackup 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\Backups\username\pc_name\ntbackup
Default location where backup files is located for ntbackup sessions

\\nas1.imm.dtu.dk\Backups\username\pc_name\ntbackup\full.bkf
File for full ntbackup sessions.

\\nas1.imm.dtu.dk\Backups\username\pc_name\ntbackup\differential.bkf
File for differential ntbackup 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.