特殊:Badtitle/NS100:BackupPC:修订间差异
小无编辑摘要 |
|||
(未显示2个用户的10个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/BackupPC}} | {{From|https://help.ubuntu.com/community/BackupPC}} | ||
{{Languages|UbuntuHelp:BackupPC}} | {{Languages|UbuntuHelp:BackupPC}} | ||
== | == Introduction == | ||
BackupPC is a free backup software suite with a web-based frontend. The cross-platform server will run on any Linux, Solaris, or UNIX based server. No client is necessary, as the server is itself a client for several protocols that are handled by other services native to the client OS. | |||
=== Backup Methods === | |||
Three methods for getting backup data from a client are: | |||
=== | * smb (Server Message Block) | ||
* tar (tape archiver) | |||
* rsync (file transfer program for Unix systems) | |||
tar | |||
rsync | |||
{|border="1" cellspacing="0" | {|border="1" cellspacing="0" | ||
|||WinXX||Linux/Unix/MacOSX | |||WinXX||Linux/Unix/MacOSX | ||
第19行: | 第17行: | ||
|tar|| ||* | |tar|| ||* | ||
|} | |} | ||
<ol><li> | <ol><li>rsync/cygwin software needs to be installed on client machine</li></ol> | ||
The easiest method for backing up windows machines is the "smb" protocol. See the BackupPC manual for the full pro's and con's | |||
=== Configuration === | |||
To configure ''BackupPC'' there are 3 options: | |||
* Web browser (Easier) | |||
* Text editor (Power user) | |||
* Combination of both (Balanced) | |||
Note: The BackupPC user manual is heavily "Text" based. | |||
=== The BackupPC Configuration Files === | |||
BackupPC's configuration files are in the `/etc/backuppc directory`. The most important ones are `/etc/backuppc/config.pl` and `/etc/backuppc/hosts`. You should open them now to become familiar with all configuration options. Both files are heavily commented, so by reading them you should understand what they do. For example, in `/etc/backuppc/config.pl` you can define how often and when BackupPC wakes up to back up the clients, when/how often it does full or incremental backups, how many log files it should keep, etc. | |||
<pre><nowiki> | <pre><nowiki> | ||
nano -w /etc/backuppc/config.pl | nano -w /etc/backuppc/config.pl | ||
第39行: | 第34行: | ||
nano -w /etc/backuppc/hosts | nano -w /etc/backuppc/hosts | ||
</nowiki></pre> | </nowiki></pre> | ||
== Installation == | |||
== | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install backuppc | sudo apt-get install backuppc | ||
</nowiki></pre> | </nowiki></pre> | ||
== Add Hosts == | |||
== | To add a client (Host) to BackupPC, we must add it to `/etc/backuppc/hosts`. That file has the following format: | ||
<pre><nowiki> | <pre><nowiki> | ||
host dhcp user moreUsers | host dhcp user moreUsers | ||
第52行: | 第45行: | ||
hostname2 1 user2 stillanotheruser | hostname2 1 user2 stillanotheruser | ||
</nowiki></pre> | </nowiki></pre> | ||
The first column contains the hostname/NetBIOS name of the client (e.g. `hostname1`), the second column whether the client is configured through DHCP, the third column contains a user that is allowed to log into the BackupPC web interface to manage that backup client, and the fourth (optional) column contains additional users that can do the same. | |||
=== | === Browse Network === | ||
'''smbtree''' is a smb browser program in text mode. It is similar to the "Network Neighborhood" found on Windows computers. It prints a tree with all the known domains, the servers in those domains and the shares on the servers. | |||
<pre><nowiki> | <pre><nowiki> | ||
smbtree -b | smbtree -b | ||
Password: | Password: | ||
</nowiki></pre> | </nowiki></pre> | ||
Don't enter a password, hit enter | |||
<pre><nowiki> | <pre><nowiki> | ||
WORKGROUP | WORKGROUP | ||
第68行: | 第61行: | ||
cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine AMD6000. Error was NT_STATUS_ACCESS_DENIED | cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine AMD6000. Error was NT_STATUS_ACCESS_DENIED | ||
</nowiki></pre> | </nowiki></pre> | ||
Your network will differ, '''BACKUP''' is the name of our '''BackupPC server''', '''AMD6000''' is the name of our Windows Vista PC we want to back up. | |||
Although `AMD6000` is configured through DHCP, dhcp should only be set to 1 if the following tests fail: | |||
<pre><nowiki> | <pre><nowiki> | ||
nmblookup AMD6000 | nmblookup AMD6000 | ||
</nowiki></pre> | </nowiki></pre> | ||
If the test is successful, it should display `AMD6000` current IP address: | |||
<pre><nowiki> | <pre><nowiki> | ||
querying amd6000 on 192.168.0.255 | querying amd6000 on 192.168.0.255 | ||
192.168.0.50 amd6000<00> | 192.168.0.50 amd6000<00> | ||
</nowiki></pre> | </nowiki></pre> | ||
Now that you know `AMD6000` current IP address, run the same test in the other direction: | |||
<pre><nowiki> | <pre><nowiki> | ||
nmblookup -A 192.168.0.50 | nmblookup -A 192.168.0.50 | ||
第111行: | 第105行: | ||
</nowiki></pre> | </nowiki></pre> | ||
(If you like you can now open a second browser and log in as `user` on `http://192.168.0.51/backuppc/`.) | (If you like you can now open a second browser and log in as `user` on `http://192.168.0.51/backuppc/`.) | ||
== Backup Linux Client (rsync) == | == Backup Linux Client (rsync) == | ||
Now we must edit /etc/backuppc/config.pl. The backup method for AMD6000 will be '''rsync''', so we set $Conf{XferMethod} = 'rsync';. | Now we must edit /etc/backuppc/config.pl. The backup method for AMD6000 will be '''rsync''', so we set $Conf{XferMethod} = 'rsync';. | ||
第166行: | 第159行: | ||
You can start the first backup of notebook manually or wait until BackupPC starts it: | You can start the first backup of notebook manually or wait until BackupPC starts it: | ||
== Backup Linux Clients (tar) == | == Backup Linux Clients (tar) == | ||
'''For some reason this does not work under Intreped/9.04, however the method described on http://www.howtoforge.com/linux_backuppc_p4 works fine! The page is complex and confusing, so you must be careful work out just which is your "client" and which is your "server"!''' | |||
BackupPC is a great backup program for an Ubuntu server. However, backing up Ubuntu client machines doesn’t work “out of the box” due to Ubuntu’s lack of a root account. The following describes how to make BackupPC work with Ubuntu's sudo implementation. By adding sudo to the TAR commands in /etc/backuppc/config.pl and adding backuppc to the sudoers list, you’re able to perform both backups and restores directly from the web-based interface. | BackupPC is a great backup program for an Ubuntu server. However, backing up Ubuntu client machines doesn’t work “out of the box” due to Ubuntu’s lack of a root account. The following describes how to make BackupPC work with Ubuntu's sudo implementation. By adding sudo to the TAR commands in /etc/backuppc/config.pl and adding backuppc to the sudoers list, you’re able to perform both backups and restores directly from the web-based interface. | ||
=== Modify /etc/backuppc/config.pl === | === Modify /etc/backuppc/config.pl === | ||
第185行: | 第179行: | ||
*Change <code><nowiki>$Conf{BackupFilesExclude} </nowiki></code>(these seem to all be temp files that you don’t really need to backup) to read | *Change <code><nowiki>$Conf{BackupFilesExclude} </nowiki></code>(these seem to all be temp files that you don’t really need to backup) to read | ||
<pre><nowiki> | <pre><nowiki> | ||
$Conf{BackupFilesExclude} = [ | $Conf{BackupFilesExclude} = ['/proc', '/dev', '/tmp', '/mnt', '/media', '/sys', '/lost+found', '/usr/src', '/var/lib', '/var/tmp', '/var/cache', '/var/spool', '/var/run', '/var/lock', '/var/games', '/home/*/.Trash', '/home/*/.mozilla/*/*/Cache', '/home/*/.mozilla/*/*/Cache.Trash']; | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Add backuppc to the sudoers list === | === Add backuppc to the sudoers list === |
2010年5月19日 (三) 21:39的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/BackupPC }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/af | • {{#if: UbuntuHelp:BackupPC|Afrikaans| [[::BackupPC/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ar | • {{#if: UbuntuHelp:BackupPC|العربية| [[::BackupPC/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/az | • {{#if: UbuntuHelp:BackupPC|azərbaycanca| [[::BackupPC/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/bcc | • {{#if: UbuntuHelp:BackupPC|جهلسری بلوچی| [[::BackupPC/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/bg | • {{#if: UbuntuHelp:BackupPC|български| [[::BackupPC/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/br | • {{#if: UbuntuHelp:BackupPC|brezhoneg| [[::BackupPC/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ca | • {{#if: UbuntuHelp:BackupPC|català| [[::BackupPC/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/cs | • {{#if: UbuntuHelp:BackupPC|čeština| [[::BackupPC/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/de | • {{#if: UbuntuHelp:BackupPC|Deutsch| [[::BackupPC/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/el | • {{#if: UbuntuHelp:BackupPC|Ελληνικά| [[::BackupPC/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/es | • {{#if: UbuntuHelp:BackupPC|español| [[::BackupPC/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/fa | • {{#if: UbuntuHelp:BackupPC|فارسی| [[::BackupPC/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/fi | • {{#if: UbuntuHelp:BackupPC|suomi| [[::BackupPC/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/fr | • {{#if: UbuntuHelp:BackupPC|français| [[::BackupPC/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/gu | • {{#if: UbuntuHelp:BackupPC|ગુજરાતી| [[::BackupPC/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/he | • {{#if: UbuntuHelp:BackupPC|עברית| [[::BackupPC/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/hu | • {{#if: UbuntuHelp:BackupPC|magyar| [[::BackupPC/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/id | • {{#if: UbuntuHelp:BackupPC|Bahasa Indonesia| [[::BackupPC/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/it | • {{#if: UbuntuHelp:BackupPC|italiano| [[::BackupPC/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ja | • {{#if: UbuntuHelp:BackupPC|日本語| [[::BackupPC/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ko | • {{#if: UbuntuHelp:BackupPC|한국어| [[::BackupPC/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ksh | • {{#if: UbuntuHelp:BackupPC|Ripoarisch| [[::BackupPC/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/mr | • {{#if: UbuntuHelp:BackupPC|मराठी| [[::BackupPC/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ms | • {{#if: UbuntuHelp:BackupPC|Bahasa Melayu| [[::BackupPC/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/nl | • {{#if: UbuntuHelp:BackupPC|Nederlands| [[::BackupPC/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/no | • {{#if: UbuntuHelp:BackupPC|norsk| [[::BackupPC/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/oc | • {{#if: UbuntuHelp:BackupPC|occitan| [[::BackupPC/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/pl | • {{#if: UbuntuHelp:BackupPC|polski| [[::BackupPC/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/pt | • {{#if: UbuntuHelp:BackupPC|português| [[::BackupPC/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ro | • {{#if: UbuntuHelp:BackupPC|română| [[::BackupPC/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/ru | • {{#if: UbuntuHelp:BackupPC|русский| [[::BackupPC/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/si | • {{#if: UbuntuHelp:BackupPC|සිංහල| [[::BackupPC/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/sq | • {{#if: UbuntuHelp:BackupPC|shqip| [[::BackupPC/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/sr | • {{#if: UbuntuHelp:BackupPC|српски / srpski| [[::BackupPC/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/sv | • {{#if: UbuntuHelp:BackupPC|svenska| [[::BackupPC/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/th | • {{#if: UbuntuHelp:BackupPC|ไทย| [[::BackupPC/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/tr | • {{#if: UbuntuHelp:BackupPC|Türkçe| [[::BackupPC/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/vi | • {{#if: UbuntuHelp:BackupPC|Tiếng Việt| [[::BackupPC/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/yue | • {{#if: UbuntuHelp:BackupPC|粵語| [[::BackupPC/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/zh | • {{#if: UbuntuHelp:BackupPC|中文| [[::BackupPC/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/zh-hans | • {{#if: UbuntuHelp:BackupPC|中文(简体)| [[::BackupPC/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BackupPC | UbuntuHelp:BackupPC | {{#if: | :}}BackupPC}}/zh-hant | • {{#if: UbuntuHelp:BackupPC|中文(繁體)| [[::BackupPC/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:BackupPC|:BackupPC|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :BackupPC/zh | | {{#ifexist: BackupPC/zh | | {{#ifeq: {{#titleparts:BackupPC|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BackupPC|1|-1|}} | zh | | }}
Introduction
BackupPC is a free backup software suite with a web-based frontend. The cross-platform server will run on any Linux, Solaris, or UNIX based server. No client is necessary, as the server is itself a client for several protocols that are handled by other services native to the client OS.
Backup Methods
Three methods for getting backup data from a client are:
- smb (Server Message Block)
- tar (tape archiver)
- rsync (file transfer program for Unix systems)
WinXX | Linux/Unix/MacOSX | |
smb | * | |
rsync | * 1. | * |
tar | * |
- rsync/cygwin software needs to be installed on client machine
The easiest method for backing up windows machines is the "smb" protocol. See the BackupPC manual for the full pro's and con's
Configuration
To configure BackupPC there are 3 options:
- Web browser (Easier)
- Text editor (Power user)
- Combination of both (Balanced)
Note: The BackupPC user manual is heavily "Text" based.
The BackupPC Configuration Files
BackupPC's configuration files are in the `/etc/backuppc directory`. The most important ones are `/etc/backuppc/config.pl` and `/etc/backuppc/hosts`. You should open them now to become familiar with all configuration options. Both files are heavily commented, so by reading them you should understand what they do. For example, in `/etc/backuppc/config.pl` you can define how often and when BackupPC wakes up to back up the clients, when/how often it does full or incremental backups, how many log files it should keep, etc.
nano -w /etc/backuppc/config.pl
nano -w /etc/backuppc/hosts
Installation
sudo apt-get install backuppc
Add Hosts
To add a client (Host) to BackupPC, we must add it to `/etc/backuppc/hosts`. That file has the following format:
host dhcp user moreUsers hostname1 0 user1 anotheruser,athirduser hostname2 1 user2 stillanotheruser
The first column contains the hostname/NetBIOS name of the client (e.g. `hostname1`), the second column whether the client is configured through DHCP, the third column contains a user that is allowed to log into the BackupPC web interface to manage that backup client, and the fourth (optional) column contains additional users that can do the same.
Browse Network
smbtree is a smb browser program in text mode. It is similar to the "Network Neighborhood" found on Windows computers. It prints a tree with all the known domains, the servers in those domains and the shares on the servers.
smbtree -b Password:
Don't enter a password, hit enter
WORKGROUP \\BACKUP backup server (Samba, Ubuntu) \\BACKUP\IPC$ IPC Service (backup server (Samba, Ubuntu)) \\BACKUP\print$ Printer Drivers \\AMD6000 cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine AMD6000. Error was NT_STATUS_ACCESS_DENIED
Your network will differ, BACKUP is the name of our BackupPC server, AMD6000 is the name of our Windows Vista PC we want to back up. Although `AMD6000` is configured through DHCP, dhcp should only be set to 1 if the following tests fail:
nmblookup AMD6000
If the test is successful, it should display `AMD6000` current IP address:
querying amd6000 on 192.168.0.255 192.168.0.50 amd6000<00>
Now that you know `AMD6000` current IP address, run the same test in the other direction:
nmblookup -A 192.168.0.50
If successful, the output should look like this:
Looking up status of 192.168.0.50 AMD6000 <00> - B <ACTIVE> WORKGROUP <00> - <GROUP> B <ACTIVE> AMD6000 <20> - B <ACTIVE> WORKGROUP <1e> - <GROUP> B <ACTIVE> MAC Address = 00-1A-92-B0-4C-63
Both tests were successful, so we can set `dhcp` to 0, and we put `AMD6000 0 user` into `/etc/backuppc/hosts` and comment out the `localhost` line:
nano -w /etc/backuppc/hosts
[...] AMD6000 0 user #localhost 0 backuppc
If the tests had not been successful, we would have put `AMD6000 1 user` into `/etc/backuppc/hosts` instead, and in addition to that we would have had to change the variable `$Conf{DHCPAddressRanges}` in `/etc/backuppc/config.pl`. We have added the user user to the hosts file. That's the system user whom BackupPC will send email reports regarding `AMD6000`, so we should create that user on the BackupPC server now:
useradd -m user passwd user
In addition to that we must create a password for user for the BackupPC web interface:
htpasswd /etc/backuppc/htpasswd user
(If you like you can now open a second browser and log in as `user` on `http://192.168.0.51/backuppc/`.)
Backup Linux Client (rsync)
Now we must edit /etc/backuppc/config.pl. The backup method for AMD6000 will be rsync, so we set $Conf{XferMethod} = 'rsync';. AMD6000 has just one (big) partition (/), so we set $Conf{RsyncShareName} == '/';. If you have multiple partitions to backup, you'd specify something like $Conf{RsyncShareName} == ['/', '/var', '/data', '/boot']; instead. rsync will be tunneled through SSH (port 22). SSH needs to know the hostname or IP address of the client. Unless you have a DNS server that resolves AMD6000 to its IP address, SSH will not be able to resolve the name AMD6000. Therefore we replace $host with $hostIP in $Conf{RsyncClientCmd} and $Conf{RsyncClientRestoreCmd}.
nano -w /etc/backuppc/config.pl
[...] $Conf{XferMethod} = 'rsync'; $Conf{RsyncClientPath} = '/usr/bin/rsync'; $Conf{RsyncClientCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{RsyncShareName} = '/'; #$Conf{RsyncShareName} = ['/', '/var', '/data', '/boot']; [...]
(You might wonder now how we can specify options for multiple clients because the options for notebook will be different from those for AMD6000. It works like this: the options in /etc/backuppc/config.pl are global values that are valid for all clients unless they have their onw configuration file in /etc/backuppc, named after their hostname. So for notebook we will create /etc/backuppc/notebook.pl, and it will contain only the values that are different from the ones in /etc/backuppc/config.pl. In fact, we could have created /etc/backuppc/falko-desktop.pl for falko-desktop instead of modifying /etc/backuppc/config.pl.)
Enable settings
Next restart BackupPC:
/etc/init.d/backuppc restart
Backup Windows Client (smb)
To make backups of Windows systems using smb, we must share the folder that we want to back up. In this case I want to backup the whole C: drive, so I right-click on it in the Windows Explorer and go to Sharing. As share name I specify C. Next, on server1.example.com, I add a line for notebook to /etc/backuppc/hosts (I do this as root). In this case I use user again as the user. If you use a different username than before, make sure you create it on the system and for the BackupPC web interface, as shown in chapter 5.
vi /etc/backuppc/hosts
[...] AMD6000 0 user notebook 0 user #localhost 0 backuppc
Then create the file /etc/backuppc/notebook.pl and add all options that are different from the ones in /etc/backuppc/config.pl. In this case we add $Conf{XferMethod} == 'smb';. Our share name is C, so we put $Conf{SmbShareName} == 'C'; into it as well as the username and password for the Windows share:
nano -w /etc/backuppc/notebook.pl
$Conf{SmbShareName} = 'C'; $Conf{SmbShareUserName} = 'username'; $Conf{SmbSharePasswd} = 'password'; $Conf{XferMethod} = 'smb';
Enable Settings
Then restart BackupPC:
/etc/init.d/backuppc restart
Then reload the BackupPC web interface again. You should now find notebook in the list of clients: You can start the first backup of notebook manually or wait until BackupPC starts it:
Backup Linux Clients (tar)
For some reason this does not work under Intreped/9.04, however the method described on http://www.howtoforge.com/linux_backuppc_p4 works fine! The page is complex and confusing, so you must be careful work out just which is your "client" and which is your "server"! BackupPC is a great backup program for an Ubuntu server. However, backing up Ubuntu client machines doesn’t work “out of the box” due to Ubuntu’s lack of a root account. The following describes how to make BackupPC work with Ubuntu's sudo implementation. By adding sudo to the TAR commands in /etc/backuppc/config.pl and adding backuppc to the sudoers list, you’re able to perform both backups and restores directly from the web-based interface.
Modify /etc/backuppc/config.pl
- Run “sudo gedit /etc/backuppc/config.pl”
- Add sudo to the TAR
Client
andClientRestore
commands - Change
$Conf{TarClientCmd}
and$Conf{TarClientRestoreCmd}
to read
$Conf{TarClientCmd} = ‘sudo $tarPath -c -v -f - -C $shareName’ . ‘ –totals’;
$Conf{TarClientRestoreCmd} = ‘sudo $tarPath -x -p –numeric-owner –same-owner’ . ‘ -v -f - -C $shareName’;
- Also remove plus (+) from $incrDate in
$Conf{TarIncrArgs}
so it won't be double escaped (need to escape only once when running sudo):
$Conf{TarIncrArgs} = '--newer=$incrDate $fileList+';
- Change
$Conf{BackupFilesExclude}
(these seem to all be temp files that you don’t really need to backup) to read
$Conf{BackupFilesExclude} = ['/proc', '/dev', '/tmp', '/mnt', '/media', '/sys', '/lost+found', '/usr/src', '/var/lib', '/var/tmp', '/var/cache', '/var/spool', '/var/run', '/var/lock', '/var/games', '/home/*/.Trash', '/home/*/.mozilla/*/*/Cache', '/home/*/.mozilla/*/*/Cache.Trash'];
Add backuppc to the sudoers list
- Run “sudo visudo”
- At the bottom of the file add
# Allow backuppc to run tar without a password backuppc ALL=NOPASSWD: /bin/tar
- If you are unfamiliar with vi editor: Scroll to the end of last line of the file, press a to start adding text, write magic lines mentioned above, hit esc, type ":w"+enter to save file, ":q" to quit (":q!" to quit without saving changes).
alternatives
For other ways of backing up some or all of your system, see BackupYourSystem .
References
- http://www.howtoforge.com/linux_backuppc
- BackupPC: http://backuppc.sourceforge.net
- BackupPC Documentation: http://backuppc.sourceforge.net/faq/BackupPC.html
Authors
- falko