Web Hosting Talk







View Full Version : Keeping a complete backup of a nix server on a home windoze machine.


M0NkEY
01-01-2004, 04:28 PM
Anyone know of any good guides for doing this?

I'm not very familiar with rsync and I've been looking at http://www.itefix.no/cwrsync/ but have ended up quite confused.

I am looking for some clear information on setting up a manual or automated way to keep a backup of one of my most important servers on my own Win XP system. (My home *nix systems don't have enough HD space on them to do this.)

Any guidance would be appreciated.

ijg0
01-01-2004, 04:47 PM
To do this I use a program winscp. You will need ssh / sftp access to your unix server to do this.


See http://winscp.sourceforge.net/eng/

Antipas
01-01-2004, 05:53 PM
If your do not mind running an ftp server on your Home box.

Here is my remote backup script it will compress the files, ftp and send an e-mail on competition



#!/bin/sh
# script for Creating backup's and ftping them to a remote server.

date=`date +%Y%m%d`

# Directory where you want the backup files to be placed
echo "Building backup directories..."
mkdir /home/backup/backup/$date
backup_dir="/home/backup/backup/$date"

# Directory's you want to backup
data1="/root"
data2="/etc"
data3="/usr/local/etc"
data4="/root/scripts"
data5="/usr/home

#name the backup's

backup_data1="root-home.tar.gz"
backup_data2="etc.tar.gz"
backup_data3="usr-local-etc.tar.gz"
backup_data4="root-scripts.tar.gz"
backup_data5="home.tar.gz"

echo "Compressing data... Using tar.gz format"

cd $backup_dir

#backup the directories filtered through gzip into backup files

tar czpf `date +%b-%d`-`hostname`-${backup_data1} $data1
tar czpf `date +%b-%d`-`hostname`-${backup_data2} $data2
tar czpf `date +%b-%d`-`hostname`-${backup_data3} $data3
tar czpf `date +%b-%d`-`hostname`-${backup_data4} $data4
tar czpf `date +%b-%d`-`hostname`-${backup_data5} $data5

echo "Creating MD5 to verify data integrity"

#md5 The resultant backup files
md5 `date +%b-%d`* >> `date +%b-%d`-checksums.md5

echo "=========> ... done"
echo "Data compression complete & local copy of backups stored in backup_dir"

#path to backup
cd /usr/home/backup/backup/$date

echo "backing up ~/.netrc file"
echo "FTPing daily backups to remote ftp server"

#Makes a backup of the old ~/.netrc file
cp $HOME/.netrc $HOME/netrc.bak

# Configures a new ~/.netrc
rm $HOME/.netrc
echo machine ftp.domain.com > $HOME/.netrc
echo login username >> $HOME/.netrc
echo password password >> $HOME/.netrc
chmod go-rwx $HOME/.netrc
echo ftpbackup log file > ftpbackup.log
echo Begin conection at: >> ftpbackup.log
date >> ftpbackup.log
ftp -i<<**
open ftp.domain.com
bin

put *-root-home.tar.gz"
put *-etc.tar.gz"
put *-usr-local-etc.tar.gz"
put *-root-scripts.tar.gz"
put *-home.tar.gz"


bye
**
echo End conection at: >> ftpbackup.log
date >> ftpbackup.log

echo "...sending backup E-mail...."

mail you@domain.com -v < ftpbackup.log

# End of ftpbackup script
echo Remote FTP backup Complete congrats......

M0NkEY
01-01-2004, 07:12 PM
thenks ijg0 and Antipas, very helpfull info!

Cheers.

ijg0
01-01-2004, 07:17 PM
I forgot to add earlier that if you are looking for encrypted transfers using a command line (windows client side) then try pscp from www.putty.nl

M0NkEY
01-01-2004, 07:50 PM
one thing about WinSCP I notice is that it just transfers file by file... and it actually follows links and downloads the file that link points to and all user info will not be sotored. Its not that great for a TOTAL system backup but its still a pretty kicka$s tool I did not know about.

monaghan
01-02-2004, 04:04 PM
Configure your rsyncd.conf similiar to this on the target box

[backups]
path = /data/backups
read only = no

then on the source box, pop this on a cron job

rsync / server.home.domain.com::backups/servername --recursive -v

and away you go.

However, you may not really want to mirror the complete unix structure, propably best to mirror /etc /var /home and any other crucial directories.

I'd suggest reading the man pages so you understand it properly though.

robnelli
04-14-2004, 05:46 PM
Antipas,

I'm trying to ftp my cpanel backup to my home machine (Windows 98) but haven't figured out what IP/domain name to use for the remote ftp server. I've tried FileZilla Server and Windows FTP Server but no luck. What did you use to address your FTP server? I'm connected using high-speed cable modem on a router.