Koozali.org: home of the SME Server

Backing up using RSYNC

Offline lproven

  • **
  • 27
  • +0/-0
Backing up using RSYNC
« on: September 28, 2004, 01:38:30 AM »
I'm having problems backing up my SME Servers.

The built-in backup/restore tool is no use whatsoever. It can't handle >2GB of stuff. My smaller servers hold 10-20GB so far and they're really new.

I can't get DMay's backup2ws to work. It is a major pain to get mapping a drive onto a Windows workstation working in a domain environment with DHCP, and when I have sorted that, the process ALWAYS fails at some point. Usually it creates 1 RAR file of the specified maximum size then stops. I believe it's meant to continue and create PART2, PART3 and so on, but it doesn't for me. This is repeatable on 2 different servers at 2 different locations. Both are on 6.0.1 and both have the latest version of backup2ws installed.

So I'm looking at using RSync.

I've installed cwRsync on a workstation but the server can't connect to it. So, I've mounted a workstation drive on the server and put it in FSTAB so it's permanent.

Then I tried manually Rsync-ing to this. It worked, but rsync is complex to configure. So, I've tried the RSNAPSHOT contrib.

This does the actual backup but subsequent runs fail. Snapshot backups require making links on the target filesystem and my targets are external USB2 hard disks on workstaitons, formatted FAT32 for portability. You can't make links on FAT32 drives. Also, this kind of backup doesn't preserve any user rights.

I've found Dmay's HOWTO on backup using RYSNC, here:

http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/dmay/mitel/howto/rsync-backup-howto.html

However, it's so brief and sketchy it's no help at all.

I've seen various other things on Rsync but they all ussume you're backing up FROM workstations TO the server. I need to go the other way round.

Is anyone else doing this? Using Rsync to backup to volumes on workstations? Ideally I'd like at least a grandfather/father/son cycle but just one-shots will do.

If so, please let me know!

Otherwise, I'm going to have to go it alone. Remove RSNAPSHOT - it's no use except against Unix filesystems, but it doesn't say this anywhere in its documentation.

Offline lproven

  • **
  • 27
  • +0/-0
Backing up using RSYNC
« Reply #1 on: September 28, 2004, 01:40:34 AM »
Clarification: when I say "remove Rsnapshot", I mean I'm going to have to remove it from my server and write my own rsync scripts manually, and schedule them manually, too.

duncan

Re: Backing up using RSYNC
« Reply #2 on: September 28, 2004, 09:51:38 AM »
Quote from: "lproven"

Otherwise, I'm going to have to go it alone. Remove RSNAPSHOT - it's no use except against Unix filesystems, but it doesn't say this anywhere in its documentation.


I am not sure I quite understand what point you are making here. In terms of the rest - perhaps this link might help. About halfway down.

Link

loveless


kirkf

Backing up using RSYNC
« Reply #4 on: October 03, 2004, 03:19:53 AM »
Quote
Otherwise, I'm going to have to go it alone. Remove RSNAPSHOT - it's no use except against Unix filesystems, but it doesn't say this anywhere in its documentation.


I have rsnapshot on a 6.0.1 server backing up my Windows XP workstations (NTFS) without issues.  Has turned out to be a great method to back up 120GB+ daily.  I followed this HOWTO:

http://no.longer.valid/phpwiki/index.php/cwRsync%20howto

Kirk

Offline lproven

  • **
  • 27
  • +0/-0
Backing up using RSYNC
« Reply #5 on: November 09, 2004, 04:07:14 PM »
kirkf/lovless/duncan:

I had already studied all those, thanks, but they don't help. I don't think you quite understand what I'm trying to do.

kirkf, you say you're backing up workstations *from* Windows *to* an SME Server.

I'm trying to backup *from* my SME Server *to* a Windows workstation. That is the reverse of what you say you're doing.

Rsnapshot creates multiple backups by using symbolic links to unchanged files. Linux can't create symlinks on an NTFS filesystem or on any filesystem it's accessing over the network on a Windows host.

Damian

Backing up using RSYNC
« Reply #6 on: November 09, 2004, 10:24:14 PM »
Liam,

We back up a number of remote SME servers via ssh/rsync daily. We're only interested in the ibays and email data so we have a SuSE 9.1 machine with 160GB HDD running the following (as examples):

Crontab entry for root:
# Rsync User&Mail Area to server2
2 22 * * * /backup/scripts/rsync_share.sh /dev/null 2>&1
# Rsync User&Mail Area to server2
2 23 * * * /backup/scripts/rsync_mail.sh /dev/null 2>&1

/backup/scripts/rsync_share.sh:
#!/bin/bash
COMPANY="COMPANY_NAME_HERE"
HOST="companyname.com"

START=date
echo "Backup report for $COMPANY - share" > /tmp/mail_rep_$COMPANY
echo "==========================" >> /tmp/mail_rep_$COMPANY
echo "" >> /tmp/mail_rep_$COMPANY
echo "Backup Start : "$START .> /tmp/mail_rep_$COMPANY
/usr/bin/rsync -ave 'ssh -C' --stats --timeout=60 --delete root@$HOST:/home/e-smith/files/ibays/share /backup/data/$COMPANY/ibays >> /tmp/mail_rep_$COMPANY
if test $? = 0; then
REPORT="Share Backup OK from $COMPANY"
else
REPORT="Share Backup FAILED from $COMPANY"
fi
END=date
echo "" >> /tmp/mail_rep_$COMPANY
echo "Backup Finish: "$END >> /tmp/mail_rep_$COMPANY
echo "" >> /tmp/mail_rep_$COMPANY
echo $REPORT >> /tmp/mail_rep_$COMPANY

cat /tmp/mail_rep_$COMPANY
mail -s "$REPORT" me@ourcompany.com < /tmp/mail_rep_$COMPANY


/backup/scripts/rsync_mail.sh:
#!/bin/bash
COMPANY="COMPANY_NAME_HERE"
HOST="companyname.com"

START=date
echo "Backup report for $COMPANY - email" > /tmp/mail_rep_$COMPANY
echo "==========================" >> /tmp/mail_rep_$COMPANY
echo "" >> /tmp/mail_rep_$COMPANY
echo "Backup Start : "$START .> /tmp/mail_rep_$COMPANY
/usr/bin/rsync -ave 'ssh -C' --stats --timeout=60 --delete root@$HOST:/home/e-smith/files/users /backup/data/$COMPANY >> /tmp/mail_rep_$COMPANY
if test $? = 0; then
REPORT="Mail Backup OK from $COMPANY"
else
REPORT="Mail Backup FAILED from $COMPANY"
fi
END=date
echo "" >> /tmp/mail_rep_$COMPANY
echo "Backup Finish: "$END >> /tmp/mail_rep_$COMPANY
echo "" >> /tmp/mail_rep_$COMPANY
echo $REPORT >> /tmp/mail_rep_$COMPANY

cat /tmp/mail_rep_$COMPANY
mail -s "$REPORT" me@mycompany.com < /tmp/mail_rep_$COMPANY

This relies on copying the public ssh key to the remote server. I expect you should be able to set up something similar using plink from the PC. Not perfect but improving all the time :-)

Damian

Damian

Backing up using RSYNC
« Reply #7 on: November 09, 2004, 10:27:32 PM »
Beware,

The lines in the scripts above starting "/usr/bin/rsync " have wrapped, so correct them if you use the script.

Damian