Using rsync over ssh to perform backups

Posted by: admin  :  Category: Ubuntu, ssh

Due to the low cost of hard disk space, the popular backup method is from hard disk to hard disk.  When backing up systems, I use rsync to synchronize data directories from one system to another.  Using SSH, this data transfer can be encrypted and even performed securely across the Internet.

The first step is to set up ssh and ssh keys.  These will allow one system to authenticate to another non-interactively.  Access to these keys must be tightly controlled, as they allow remote authentication.

  1. mkdir /root/keys
  2. chown root:root /root/keys
  3. chmod 700 /root/keys
  4. ssh-keygen -t dsa -b 2048 -f /root/key/`uname -n`-rsync-key
  5. When prompted for a passphrase, simply press enter
  6. scp `uname -n`-rsync-key.pub user@remotehost:/root/.ssh/
  7. from the remote server: cat backuphost-rsync-key.pub /root/.ssh/authorized_keys

To backup systems, I create a script in /root/bin for each remote host I am backing up.  The example below is used to backup a web server’s data files and configuration.

#!/bin/sh

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/root/keys/local host name-rsync-key
RUSER=remote user name
RHOST=remote host
LPATH=/data/backup/$RHOST/

BACKUPDIR=`date +%A`
OPTS=”–force –ignore-errors –delete –backup –backup-dir=$LPATH/$BACKUPDIR -az”

$RSYNC $OPTS -e “$SSH -i $KEY” $RUSER@$RHOST:/home $LPATH/current
$RSYNC $OPTS -e “$SSH -i $KEY” $RUSER@$RHOST:/srv $LPATH/current
$RSYNC $OPTS -e “$SSH -i $KEY” $RUSER@$RHOST:/etc/apache2 $LPATH/current/etc
$RSYNC $OPTS -e “$SSH -i $KEY” $RUSER@$RHOST:/etc/mysql $LPATH/current/etc

Each backed up host will have a unique directory, with a full backup in the current directory and differentials in directories based on the day of the week.

Webmin on Ubuntu 9.04

Posted by: admin  :  Category: Ubuntu

Install the needed prerequisites.  Perl, OpenSSL, and supporting libraries.
sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

Download and install the latest webmin.
wget http://voxel.dl.sourceforge.net/sourceforge/webadmin/webmin_1.480_all.deb | sudo dpkg -i

Webmin can be accessed securely on port 10000 using any credentials present in the sodoers file.
https://localhost:10000

Groupwise 8 client on Ubuntu 9.04

Posted by: admin  :  Category: Jaunty Jackalope 9.04, Novell Groupwise, Ubuntu

Novell offers a full featured Linux client for its Groupwise mail system.  The release version is built as rpm files, which integrates nicely with SuSE Linux Enterprise Desktop, but does not install directly on debian/ubuntu based systems.

Installation of the Groupwise client in Ubuntu Jaunty is relatively straight forward.

1.  Download the Groupwise 8 Client from your Software Distribution Directory (SDD).  Typically this is /opt/novell/groupwise/software/
2.  sudo apt-get install sun-java6-jre java-common alien libstdc++5
3.  sudo alien -i novell-groupwise-gwclient-8.0.0-<buildnumber>.i586.rpm
4.  sudo rm -rf /opt/novell/groupwise/client/jre
5.  sudo ln -s /usr/lib/jvm/java-6-sun/jre /opt/novell/groupwise/client/jre

cheap cell phone accessories affiliate marketing Bad Credit Loan Motor-vehicle