BackupPC is a great backup solution. We use it in our enterprise for over 5TB of data and it runs like a champ, using version 3.1.0 on Debian Lenny.
Using BackupPC to backup Windows servers, however, has been frustrating. The Excludes parameters don't work like I expect when backing up over Samba (smb/cifs) shares. I've developed some Rules of Thumb, through internet reading and my own trial-and-error, which have led me to the BackupPC config file specifics for the Excludes section.
We're not backing up the Program Files etc under the understanding that a Windows machine can't run just as a collection of files and a restore of such wouldn't run the OS. This also doesn't include any changes to Windows permissions which allow access for the user account (in the example config below, that user is in the Contoso domain, so contoso/backuppc)
lefty's BackupPC Config Files Rules of Thumb for Windows Computers (whew):
$Conf{SmbShareName} = 'C';
$Conf{SmbShareUserName} = 'contoso/backuppc';
$Conf{SmbSharePasswd} = 'S0M3PASS';
$Conf{BackupFilesOnly} = undef;
$Conf{BackupFilesExclude} = {'*' => [
'\\mvBase2.0\\Data\\\\*',
'\\WUTemp\\\\*',
'\\\$Recycle.Bin\\\\*',
'\\Boot\\\\*',
'\\autoexec.bat',
'\\\\bootmgr',
'\\\\BOOTSECT.BAK',
'\\\\config.sys',
'\\\\hiberfil.sys',
'\\\\pagefile.sys',
'\\MSOCache',
'\\\\pagefile.sys',
'\\PerfLogs\\\\*',
'\\ProgramData\\\\*',
'\\Recovery\\\\*',
'\\System Volume Information\\\\*',
'\\tmp\\\\*',
'\\Windows\\\\*',
'\\WINDOWS\\\\*',
'\\Users\\*\\Documents\\My Music\\\\*',
'\\Users\\*\\Documents\\My Pictures\\\\*',
'\\Users\\*\\Documents\\My Videos\\\\*',
'\\Users\\*\\Local Settings\\\\*',
'\\Users\\*\\My Documents\\\\*',
'\\Users\\*\\NetHood',
'\\Users\\*\\PrintHood',
'\\Users\\*\\Recent\\\\*',
'\\Users\\*\\SendTo\\\\*',
'\\Users\\*\\Start Menu\\\\*',
'\\Users\\*\\Templates\\\\*',
'*NTUSER.DAT',
'*ntuser.dat.LOG1',
'*ntuser.dat.LOG2',
'*.lock',
'Thumbs.db',
'IconCache.db',
'Cache',
'cache',
] };
$Conf{XferMethod} = 'smb';
On the Windows server make sure that the backup account exists and the password functions. Then add one of these registry keys:
New 32bit DWord key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\]
"DisableStrictNameChecking"=dword:1
OR this key:
New Multi-string key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\]
value: "OptionalNames"
type: multi-string
content: the alias-hostname(s), such as 'accounting server' and 'antivirus'
and add this key,
New 32bit DWord key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\]
"LocalAccountTokenFilterPolicy"=dword:1.
Using BackupPC to backup Windows servers, however, has been frustrating. The Excludes parameters don't work like I expect when backing up over Samba (smb/cifs) shares. I've developed some Rules of Thumb, through internet reading and my own trial-and-error, which have led me to the BackupPC config file specifics for the Excludes section.
We're not backing up the Program Files etc under the understanding that a Windows machine can't run just as a collection of files and a restore of such wouldn't run the OS. This also doesn't include any changes to Windows permissions which allow access for the user account (in the example config below, that user is in the Contoso domain, so contoso/backuppc)
lefty's BackupPC Config Files Rules of Thumb for Windows Computers (whew):
- Directories directly on the root of a drive (C:\) need to start with two slashes: \\
- Files directly off the root need to be preceded with four slashes: \\\\
- Hidden shares or other things that have a dollar sign ($) need that dollar sign to be escaped with a slash: \$
- Directory structures need to end with four slashes and a star: \\\\*
- Each item needs to be enclosed in a pair of 'single-quotes' and followed by a comma,
$Conf{SmbShareName} = 'C';
$Conf{SmbShareUserName} = 'contoso/backuppc';
$Conf{SmbSharePasswd} = 'S0M3PASS';
$Conf{BackupFilesOnly} = undef;
$Conf{BackupFilesExclude} = {'*' => [
'\\mvBase2.0\\Data\\\\*',
'\\WUTemp\\\\*',
'\\\$Recycle.Bin\\\\*',
'\\Boot\\\\*',
'\\autoexec.bat',
'\\\\bootmgr',
'\\\\BOOTSECT.BAK',
'\\\\config.sys',
'\\\\hiberfil.sys',
'\\\\pagefile.sys',
'\\MSOCache',
'\\\\pagefile.sys',
'\\PerfLogs\\\\*',
'\\ProgramData\\\\*',
'\\Recovery\\\\*',
'\\System Volume Information\\\\*',
'\\tmp\\\\*',
'\\Windows\\\\*',
'\\WINDOWS\\\\*',
'\\Users\\*\\Documents\\My Music\\\\*',
'\\Users\\*\\Documents\\My Pictures\\\\*',
'\\Users\\*\\Documents\\My Videos\\\\*',
'\\Users\\*\\Local Settings\\\\*',
'\\Users\\*\\My Documents\\\\*',
'\\Users\\*\\NetHood',
'\\Users\\*\\PrintHood',
'\\Users\\*\\Recent\\\\*',
'\\Users\\*\\SendTo\\\\*',
'\\Users\\*\\Start Menu\\\\*',
'\\Users\\*\\Templates\\\\*',
'*NTUSER.DAT',
'*ntuser.dat.LOG1',
'*ntuser.dat.LOG2',
'*.lock',
'Thumbs.db',
'IconCache.db',
'Cache',
'cache',
] };
$Conf{XferMethod} = 'smb';
On the Windows server make sure that the backup account exists and the password functions. Then add one of these registry keys:
New 32bit DWord key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\]
"DisableStrictNameChecking"=dword:1
OR this key:
New Multi-string key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\]
value: "OptionalNames"
type: multi-string
content: the alias-hostname(s), such as 'accounting server' and 'antivirus'
and add this key,
New 32bit DWord key:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\]
"LocalAccountTokenFilterPolicy"=dword:1.