The main purpose of this project was to build a server which could collect information from all of the outlying server and bring them to a central repository system. I like to use it for webserver so that I can have lets say 3 different flavors of linux running legacy systems. Backing those up is very cumbersome so having a CRONTAB job to automatically sync the files back to a central unit makes it much easier to restore them should anything happen to that server. Below is the information on how I created this on Ubuntu 8.10. I am sure it can be changed a bit to work on other systems.
Let install a couple of software apps on the server
apt-get install rsync
apt-get install xinetd |
1. Edit /etc/default/rsync to start rsync as daemon using xinetd.
Now look for the following code below and change.
2. Create /etc/xinetd.d/rsync to launch rsync via xinetd.
Now paste the information below:
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
} |
3. Create /etc/rsyncd.conf configuration for rsync in daemon mode.
Now paste the following information below:
ax connections = 5
log file = /var/log/rsync.log
timeout = 300
[rbackup]
comment = Public Share
path = /home/rbackup
read only = no
list = yes
uid = rbackup
gid = rbackup
auth users = rbackup
secrets file = /etc/rsyncd.secrets
hosts allow = 10.10.1.248 |
4. Create /etc/rsyncd.secrets for user’s password.
Now paste the following information below
Now change the permissions on the file
chmod 600 /etc/rsyncd.secrets |
5. Start/Restart xinetd
/etc/init.d/xinetd restart |
Now you can test this from another machine
rsync user@10.10.2.100::share |
NOTE: is you want to setup a password file you will have to create it on the source server and then change the permissions on the file in order for it to work properly.
Just enter the password in the file no extra spaces or other characters then chmod the permissions
Example of a rsync script
rsync -avz --password-file=/password /DB_Backups/ user@10.10.2.100::share |
There are tons of scripts you can run and also changing the flags to preserve the permissions of the files. Have fun!!
We recently wanted to migrate the Ahsay OBS replica from Windows and Mac OS X to Ubuntu Linux 64-bit. I found it very challenging to get it going so I thought I would share my notes.
After downloading the Ahsay 5.x software and setting up a clean Ubuntu 8.10 Image I did the following:
mkdir /usr/local/obs
OBS_HOME=/usr/local/obs; export OBS_HOME |
I then got the installer from Ashay then ran the following
cp obsr-nix.tar.gz $OBS_HOME
gunzip obsr-nix.tar.gz
tar -xf obsr-nix.tar |
I then got from their website the latest Java 64 runtime and then
mv java java.bak
wget http://download.ahsay.com/temp/support/java/java16u3\(x64\).tar.gz
gunzip java16u3(x64).tar.gz
tar -xf java16u3(x64).tar |
Once you have the new folder for the java then I ran the installer
sh $OBS_HOME/bin/install.sh |
After that I was ready to log into the machine and complete the setup via the web portal.
This is the result of the install.
Log Time: Fri Nov 6 11:14:33 PST 2009
Start configuration on Generic Linux Platform (Linux)
Using OBSR_HOME /usr/local/obs
Created symbolic link at /usr/local/obs/java
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02, mixed mode)
JVM is verified for installation!
Installing [ Ahsay Offsite Backup Server and Replication Server ]
[ Ahsay Offsite Backup Server and Replication Server ] Service Script created at /usr/local/obs/bin/obsr
Install Service for NIX type OS
Using init script path /etc/init.d
Using run level script path /etc
Copying script obsr to /etc/init.d
Creating symbolic link to run levels
You may start this service by:
sh "/etc/init.d/obsr" start &
[ Ahsay Offsite Backup Server and Replication Server ] setup completed!
Startup [ Ahsay Offsite Backup Server and Replication Server ]
Started [ Ahsay Offsite Backup Server and Replication Server ] |
The standard installs I do for CentOS don’t come with SNMP installed. I used the GUI to get the SNMP then do the following commands:
Rename the default configuration file
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.bak |
Create new file with your own SNMP configuration
Paste the following information into the terminal window
###########################################################################
#
# snmpd.conf
#
# - created by the snmpconf configuration program
#
###########################################################################
# SECTION: System Information Setup
#
# This section defines some of the information reported in
# the “system” mib group in the mibII tree.
# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the “notWritable” error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string
syslocation SAVVIS
# syscontact: The contact information for the administrator
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysContact.0 variable will make
# the agent return the “notWritable” error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: contact_string
syscontact Arthur Gressick
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]
rocommunity public
###########################################################################
# SECTION: Agent Operating Mode
#
# This section defines how the agent will operate when it
# is running.
# agentaddress: The IP address and port number that the agent will listen on.
# By default the agent listens to any and all traffic from any
# interface on the default SNMP port (161). This allows you to
# specify which address, interface, transport type and port(s) that you
# want the agent to listen on. Multiple definitions of this token
# are concatenated together (using ‘:’s).
# arguments: [transport:]port[@interface/address],…
agentaddress 10.10.x.x:161 |
Then reload the SNMP service from the gui and if you have cacti monitoring your OS try and connect.