- Sun virtual box
- created new VM, dynamicaly expanding HD (~90gb)
- set up networking for bridged
- set the mac address to: 08:00:27:44:43:FB
- create backup pool HD
- in the settings menu, click the + icon on the HD icon; select "create"
- make it dynamically expanding
- name it backuppc_pool, and save it to an external HD
- make its size 940gb
- on the command line
- $ VBoxManage modifyhd $PATH_TO_HD --type writethrough
- fresh install of ubuntu 9.10 server
- default options until hostname
- @hostname = backuppc-server
- @partition disks = Guided use entire disk and set up LVM
- @set up users and passwords
- new user = bgadmin
- username for your account = bgadmin
- password (for development) = qaz
- dont encrypt home directory
- @select and install software
- no automatic updates
- @software selection only choose OpenSSH Server
- reboot, removing the virtual cdrom
- CREATE SNAPSHOT OF FRESH INSTALLATION (fresh install)
- Update/upgrade all packages
- $ sudo apt-get update
- $ sudo apt-get upgrade
- CREATE A NEW SNAPSHOT AFTER UPDATES (updates post fresh install)
- Install Avahi
- $ sudo apt-get install avahi-daemon
- configure avahi
- $ sudo vi /etc/avahi/avahi-daemon.conf
- #host-name=foo => host-name=backuppc-server
- Install Backuppc
- $ sudo apt-get install backuppc
- local only for postfix configuration
- default for system mail name
- apache2 for backuppc
- web user with the following credentials
- backuppc
- xliI1Raf (change with `htpasswd /etc/backuppc/htpasswd backuppc`)
- $ sudo htpasswd /etc/backuppc/htpasswd backuppc
- chaned to: cinagro77
- Install PureFTPd
- $ sudo apt-get install pure-ftpd
- CREATE A SNAPSHOT AFTER MAIN APPLICATIONS ARE INSTALLED
- PureFTPD configuration
- $ sudo groupadd ftpgroup
- $ sudo useradd -g ftpgroup -d /dev/null -s /etc ftpuser
- $ cd /etc/pure-ftpd/auth
- $ sudo ln -s /etc/pure-ftpd/conf/PureDB 50pure
- $ sudo mkdir -p /var/ftp/pureftp/bguser (create that structure)
- $ sudo pure-pw useradd bguser -u ftpuser -g ftpgroup -d /var/ftp/pureftp/bguser
- using password: cinq50
- $ sudo pure-pw mkdb
- $ sudo vi /etc/pure-ftpd/conf/PAMAuthentication
- yes => no
- create folders and set permissions for file transfers
- $ cd /var/ftp/pureftp/bguser
- $ sudo mkdir server-key client-keys client-configs default-configs client-kh
- $ sudo chown root:ftpgroup *
- $ sudo chmod g+r-w server-key default-configs
- $ sudo chmod g+w-r client-*
- restart pureftp
- $ sudo /etc/init.d/pure-ft restart
- BackupPC configuration - SSH/config files
- $ sudo su -s /bin/bash backuppc
- $ cd /etc/backuppc
- $ mkdir client-keys client-kh client-configs
- $ rm /etc/backuppc/pc
- $ ln -s /etc/backuppc/client-configs/ /etc/backuppc/pc
- $ mkdir .ssh
- $ chmod 700 .ssh
- $ cd .ssh
- $ ssh-keygen -t rsa -f id_rsa -N '' (pair of single quotation marks)
- $
- $ touch authorized_keys known_hosts
- $ chmod 600 authorized_keys known_hosts (should be needed, use if authorized_keys isnt writeable)
- $ exit (go back to bgadmin)
- $ sudo chown backuppc:www-data /etc/backuppc/client-configs /etc/backuppc/pc
- copy the server ssh key to the appropriate directory for the clients to get
- $ sudo cp /etc/backuppc/.ssh/id_rsa.pub /var/ftp/pureftp/bguser/server-key/backuppc_id_rsa.pub
- $ sudo chown root:ftpgroup /var/ftp/pureftp/bguser/server-key/backuppc_id_rsa.pub
- $ sudo chmod g+r /var/ftp/pureftp/bguser/server-key/backuppc_id_rsa.pub
- Add bgadmin to the working groups for this project
- $ sudo usermod -a -G backuppc,ftpgroup bgadmin
- CREATE A SNAPSHOT AT THIS POINT
- $ sudo shutdown -P now
- Making the initial backup pool HD
- $ sudo parted /dev/sdb
- mklabel
- gpt
- mkpart
- backuppc_pool
- ext4
- 0%
- 100%
- quit
- sudo mkfs.ext4 -L backuppc_pool /dev/sdb1
- Pointing the pool to the new disk
- mount the fresh filesystem
- $ sudo mount -t ext4 /dev/sdb1 /mnt
- copy the files residing where the mount point will be
- $ sudo cp -dpR /var/lib/backuppc/. /mnt
- unmount the filesystem
- $ sudo umount /dev/sdb1
- move the fresh directory in case of foul up (can also use the original directory on a fresh drive)
- $ sudo mv /var/lib/backuppc /var/lib/backuppc.orig
- make the new directory, that will be the mount point
- $ sudo mkdir /var/lib/backuppc
- mount the filesystem to this diectory
- $ sudo mount -t ext4 /dev/sdb1 /var/lib/backuppc
- if everything is ok, add the mount to fstab
- $ sudo vi /etc/fstab (deliniated with spaces, I believe)
- LABEL=backuppc_pool /var/lib/backuppc ext4 defaults,auto 0 2
- BackupPC configuration - Migrate default .SSH directory
- make a link to the .ssh directory in .etc
- $ sudo ln -s /etc/backuppc/.ssh /var/lib/backuppc/.ssh
- Make a very simple script to automate moving new client data
- $ sudo vi /sbin/import-client-data
- #! /bin/bash
- echo "Copying client configuration files..."
- mv -uv /var/ftp/pureftp/bguser/client-configs/*.pl /etc/backuppc/
- echo "Combining client rsa keys..."
- mv -uv /var/ftp/pureftp/bguser/client-keys/*.pub /etc/backuppc/.ssh/client-keys/
- mv -uv /var/ftp/pureftp/bguser/client-kh/*.kh /etc/backuppc/.ssh/client-kh
- cat /etc/backuppc/.ssh/client-keys/*.pub > /etc/backuppc/.ssh/authorized_keys
- cat /etc/backuppc/.ssh/client-kh/*.kh > /etc/backuppc/.ssh/known_hosts
- $ sudo chmod +x /sbin/import-client-data (always run the script with sudo)
- ALL INITIAL SETUP IS DONE - CREATE A SNAPSHOT HERE
- Edit some server stuff on the web
- go to http://backuppc-server.local/backuppc/index.cgi?action=editConfig
- click the Xfer tab
- xfermethod: smb => rsync
- rsync args: add " --checksum-seed=32761 "
- $Conf{BackupFilesOnly} = {
- '*' => [
- '/Users/USERNAME'
- ]
- };
- $Conf{BackupFilesExclude} = {
- '*' => [
- '.DS_Store'
- ]
- };
- $Conf{RsyncClientCmd} = '$sshPath -c blowfish -q -x -l USERNAME $host $rsyncPath $argList+';
- $Conf{RsyncClientRestoreCmd} = '$sshPath -c blowfish -q -x -l USERNAME $host $rsyncPath $argList+';
