Offsite Backup Solution


 
Thread Tools Search this Thread
Operating Systems AIX Offsite Backup Solution
# 1  
Old 09-10-2009
Offsite Backup Solution

I'm looking for a program or some way to backup my server to another location onto another server. Does anyone have any ideas? What utility, server O/S(I would like to use Linux RH or CentOS)?

Whats the best way to do this?
I am fairly new with Unix.

Thanks in advance
# 2  
Old 09-10-2009
There can be many solutions. which OS are the servers on?
# 3  
Old 09-10-2009
server OS's

Quote:
Originally Posted by balaji_prk
There can be many solutions. which OS are the servers on?
The server that needs backed up is on UNIX-AIX 6. I would like to use a linux distro for the destination server, CentOS or Fedora. Eventually might go to RedHat.
# 4  
Old 09-10-2009
Which sort of backup should it be? AIX offers a so-called "mksysb", which backs up the rootvg. This results in a system backup with all the systems relevant data saved (users, groups, passwords, mountpoints, printqueues, interfaces and the like), but not (if the system is set up correctly) the data or the applications. Basically the mksysb issues a "savevg rootvg" and adds some additional logic to that so that the resulting file could be booted from if it is written to a bootable medium.

If you want to back up the remainder of your system you should set apart the static parts (say, the applications executables) and the volatile parts of your data (database files for instance) and develop different backup strategies for these.

Another point is the size of the backup and the timeframe you have for taking the backup: local disks as destination are faster than network and you can transfer the backup file(s) over the network later. Still you have to have enough diskspace to do that. Taking the backup directly over the network is slower, but doesn't require the extra disk space. On the other hand taking backups over the network might put some strain on the network hardware and/or the destination host. Maybe there are some other hosts sending their backups over the network too and the compete for the network bandwith and the I/O bandwidth of the backup server - in this case you need a schedule so that only one server is backing up at any given time.

Tell us more about your environment and your requirements and we might be able to help you better instead of telling you some commonplaces about backups.

Regarding software: i would stick with something as simple as possible: tar, maybe rsync, ftp, scp and something such.

I hope this helps.

bakunin
# 5  
Old 09-10-2009
I have a Unix-AIX server that hosts our ERP system. A full backup of the /u2 directory which is a Universe Database is scheduled every night on tape, I also do a mksysb every month on tape manually. What i need to do is backup or put a backup file of the Universe Database onto a server at my other location everyday. The backup could be ran at night and then transfered to the server in the other location, i believe i have the diskspace or it could be done over the network at night as mentioned by Bakunin. There is only roughly 20GB of data being backed up.

I would like to try using rsync, however i have no experience with it at all. I know it's not installed on my server so i would need help getting it installed. I have mostly worked with linux and am a little unsure on how to install programs in unix. It would all have to be done via command line as that is how my system is setup.
I have a WAN setup between locations so it should be easy to get the data there.

Let me know what other info you might need.

thanks for the help.

Last edited by ITAdmin08; 09-10-2009 at 03:23 PM..
# 6  
Old 09-11-2009
There are two different problems, lets discuss it one by one:

I suppose the data reside on some sort of SAN device. To read and write 20GB of data is a matter of some minutes, maybe a quarter hour (if things go really wrong). We can afford to have the backup reside on the local machine.

We need a script, which does the following:

- stop the application
- tar (and gzip?) the data to the (local) backup destination
- start up the application again

The script should issue some sort of alert (alerting a management system like Patrol/HP-Openview/etc. or mail to root or whatever) if anything goes wrong.

Then lets turn our attention to the backup server. We need a script there which does the following:

- contact the server to be backed up.
- pull the file the server has already created that day
- delete old backups on the system if we want to have only a certain number of generations online

Again, if anything goes wrong the system should complain somehow.

It is good to have the taking and the pulling over of the backup NOT tied together (that would have been possible) because this way you can take the backup when the client has time and then pull over the backup when the backup system has time.

Both these scripts will be put into crontab to run daily (or whatever timely pattern you want them to run).

Lets start with the scripts. Since i don't know your exact environment these scripts are a sketch of course. You will have to fill in the details yourself:

Code:
#! /bin/ksh
# backup script. Takes a copy of some data, with tar and stops/restarts the
# application

function send_alert
{
# This will send all the alerts. It gets some message, like "file not found", 
# and issues an alert with exactly this message. Probably you will have to
# adapt this function to suit your needs, i just output at <stderr> for
# demonstration purposes

typeset msg="$1"

print -u2 "$msg"

return 0
}




function take_backup
{
typeset destination="$1"
typeset source="$2"

tar -cvf ${destination} ${source}
# alternatively, with compression:
# tar -cvf - ${source} | gzip -9 > ${destination}

if [ "$?" -ne 0 ] ; then
     send_alert "problem writing backup file"
     return 1
fi

return 0
}




function stop_application
{

<...whatever is necessary to stop the app...>

# control if the app is really stopped. If not we raise an alert and main() will exit:
if [ $(ps -fe | grep -c <application>) -gt 1 ] ; then
     send_alert "Not able to stop application"
     return 1
fi

return 0
}




function start_application
{

<...whatever is necessary to start the app...>

# control if the app is really started. If not we raise an alert and main() will
# exit. Note that the test if there is at least one process running is just an
# example. Replace the test with whatever would make you sure the app is
# running again:
sleep 30     # give things time to settle

if [ $(ps -fe | grep -c <application>) -lt 2 ] ; then
     send_alert "Not able to start application"
     return 1
fi

return 0
}



# -------- main()
# The following is necessary, we will run in cron once. You might want to set
# other necessary environment variables here too
typeset PATH=<whatever you need>
typeset TERM=<whatever you need>
export TERM; export PATH

typeset approot="/path/to/your/data"
typeset budest="/path/to/backup/destination"
typeset today="$(date '+%Y%m%d')"   # we will use this to name the backup files

stop_application
if [ "$?" -ne 0 ] ; then
     exit 1
fi

take_backup ${budest}/backup_${today}.tar $approot
if [ "$?" -ne 0 ] ; then
     exit 1
fi

start_application
if [ "$?" -ne 0 ] ; then
     exit 1
fi

exit 0

Note that this is really a sketch: for instance there is no provision to delete old backup files when they are no longer necessary. Ideally the script for the backup server should do this after pulling over the file successfully. Still it would probably be nice to have the last backup generation on the originating server in case we have to restore something, so there is room for some scripting for you.

Lets turn to the matter of software installation: You find a pinned thread with important URLs at the top of this forum. Among these URLs is IBMs "Linux toolbox for AIX", where you can download all the necessary tools already packaged in rpm-format.

You first have to install the rpm installer itself, which is a package in AIX' native bff-format. (AIX has its own packaging format.)

To install packages in bff-format:

- copy the downloaded packages to a directory
- change to this directory and issue "inutoc .", which will create a file ".toc"
- issue "installp -ac -d. -Y -g <package_name>" to install a package


To install packages in rpm-format:

- copy the downloaded packages to a directory
- change to this directory
- issue "rpm -i <packagefile>" to install to package

I hope this helps.

bakunin
# 7  
Old 09-14-2009
Current Backup Script

Here is our current backup script that backs up to /dev/rmt0

Code:
#!/bin/ksh
###
# Eclipse Data Backup Script
# (executed by backup phantom)
###

###
# Environment Variables
###
TAPEDEV=rmt0            # Tape Device Name
BLOCKSZ=1024            # Tape Block Size
LOCKOUT=NO                      # Lockout Users During Backup (YES/NO)
QUIESCE=NO                      # Quiesce the database during backup
CHKFILE=/tmp/backup.chk         # Backup Check File
BAKFILE=/tmp/backup.bak         # Last Succesful Backup
ERRFILE=/tmp/backup.err         # Backup Error File
ALGFILE=/tmp/backread.alog      # Readback alog File
RDBFILE=/tmp/backread.err       # Readback error File
EMLFILE=/tmp/backup.email       # Email log file
BAKLIST=./u2            # Files/Directories to backup
READBAK=NONE            # Day to do a readback (EVERY/NONE/DOW)
FILELST=                # Alternate Backup File List
MAILRPT=NO                      # Mail backup report?
MAILFRM='root'
MAILLST=''      # Backup Administrator's Email Addresses
DOW=`date +%a`          # Day of week

###
# Start
###
umask 000                       # Set File Creation Flags
echo "Backup started at : `date`" > $CHKFILE
cd /

###
# Lockout Logins
###
if [ $LOCKOUT = "YES" ] ; then
        touch /etc/nologin
fi

###
# Quiesce
###
if [ $QUIESCE = "YES" ] ; then
        echo "Quiesce started at : `date`" >> $CHKFILE
        /u2/uv/bin/uv -admin -L
        if [ $? -ne 0 ] ; then
                echo "QUIESCE ERRORS RECORDED!"
        fi
fi

###
# Configure Device
###
chdev -l $TAPEDEV -a block_size=$BLOCKSZ 2> $ERRFILE >&-
sleep 35

###
# Run Backup
###
if [ -f $FILELST ] ; then
        find `cat $FILELST` -print | backup -iqvf /dev/$TAPEDEV 2>> $ERRFILE |grep -v "^a  " 1>> $ERRFILE 2>&1
else
        find $BAKLIST -print | backup -iqvf /dev/$TAPEDEV 2>> $ERRFILE |grep -v "^a  " 1>> $ERRFILE 2>&1
fi
echo "Backup ended at: `date`" >> $CHKFILE

###
# Un-Quiesce
###
if [ $QUIESCE = "YES" ] ; then
        /u2/uv/bin/uv -admin -U
        if [ $? -ne 0 ] ; then
                echo "UNQUIESCE ERRORS RECORDED!"
        fi
        echo "Quiesce completed at : `date`" >> $CHKFILE
fi

###
# End Lockout
###
if [ $LOCKOUT = "YES" ] ; then
        rm /etc/nologin
fi

###
# Run Readback
###
if [[ $READBAK = $DOW || $READBAK = "EVERY" ]] ; then
        echo "Readback started at: `date`" >> $CHKFILE
        rm $ALGFILE 2>&- >&-
        echo "Read errors recorded below" > $RDBFILE
        restore -Tqf /dev/$TAPEDEV 2>&1 1>&- | alog -q -s 8192 -f $ALGFILE
        alog -o -f $ALGFILE >> $RDBFILE
        rm $ALGFILE 2>&- >&-
        echo "Readback ended at: `date`" >> $CHKFILE
fi

###
# Eject/Unmount Device
###
tctl -f /dev/$TAPEDEV offline 2>> $ERRFILE

###
# Mail Backup Report
###
if [ $MAILREPORT = "YES" ] ; then
        cat -q $CHKFILE $ERRFILE $BAKFILE > $EMLFILE
        mailx -s "Eclipse Backup Report of `hostname`" -r $MAILFRM $MAILLST < $EMLFILE
        rm $EMLFILE
fi

###
# End
###

Is there any way i could copy and edit this script?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Backup solution using rsync

Hello All, I am looking at a fast way to script some backups. I am looking at using rsync to do the leg work. I am having a hard time conceiving a script though. I have a tree with subfolders within subfolders. I was looking at the /xd option to parse the tree. Directory of k:\ ... (4 Replies)
Discussion started by: jvamos
4 Replies

2. Shell Programming and Scripting

Considered basic but advanced outcome (Custom Backup Solution)

Ive a problem that I'm reaching out for help. Ive written (With bits and pieces) of script that is not running as expected or is having an issue causing processes to spiral out of control. The script does this: Unloads a UV database server Tars up a few folders Transfers the file to... (11 Replies)
Discussion started by: coastdweller
11 Replies

3. Solaris

OpenSource / Free backup and restore solution for Solaris 10

Is there any free /opensource backup&restore solution available for solaris10 i want to backup Solaris10 machine with oracle 9 version. (0 Replies)
Discussion started by: kashif_islam
0 Replies

4. Linux

Backup solution

Hi all, i am not sure whether i selected the right topic or not, so excuse me, well i am mainly a Windows admin, but i do *NIX administration from time to time, for now i need to use an open source solution for backup windows environment mainly, i spent last days playing with bacula and backupPC,... (0 Replies)
Discussion started by: XP_2600
0 Replies

5. AIX

Backup solution

Hello, I'm looking for a backup solution for my system. I have 3 AIX virtual partitions running on a IBM p5 server. Each partition has it's data on a DS4700 storage server. Also, I have a RedHat running on an IBM p720. This server has the tape hardware. I would like to know if I can backup from... (4 Replies)
Discussion started by: enzote
4 Replies

6. Solaris

Sun and backup solution

My company is in the process of building a new datacenter and I am responsible for setting up the backup environment (everything from racking to implementation). I guess it is pretty basic but I don't have much experience with the initial setup. What we have so far is a SunV890 (backup server), Sun... (1 Reply)
Discussion started by: Jshwon
1 Replies

7. UNIX for Advanced & Expert Users

enterprise backup solution

We are using sun_sparc solaris 2.5.1 with oracle database 8.0.5 We are considering to buy for buying backup software for this purpose . Our systems integrator says veritas could not be installed due to some technical reasons (they are veritas authorised dealer) . And is suggesting Netvault... (3 Replies)
Discussion started by: Hitesh Shah
3 Replies

8. UNIX for Dummies Questions & Answers

offsite backup for solaris

any hot sites out there for backup of a sun unix server. can't verify my tape backups and want a "disaster recovery" option (1 Reply)
Discussion started by: jbksman
1 Replies
Login or Register to Ask a Question