Could
always use FtpBackup:
1) You
will need to install ftpbackup on your server... follow the following
instructions:
- telnet into the server as admin
- gain root access, type su - and enter your root password
- type wget http://netsw.org/net/ip/filetrans/ftp/ftpbackup/ftpbackup-2.1.tar.gz
- type tar zxvf ftpbackup-2.1.tar.gz
- type cd ftpbackup-2.1
- type make
- type make install
- telnet into the server as admin
- gain root access, type su - and enter your root password
- type wget http://netsw.org/net/ip/filetrans/ftp/ftpbackup/ftpbackup-2.1.tar.gz
- type tar zxvf ftpbackup-2.1.tar.gz
- type cd ftpbackup-2.1
- type make
- type make install
2) Now
that we have ftpbackup installed on the server, we need to setup the script that
makes the magic...
- telnet into the server as admin
- gain root access, type su - and enter your root password
- type vi /backup.pl
- type i
- edit the "FTP Server Information here" variables in the Perl script (BELOW) to match your own:
$ftps = server name is the hostname or IP address of the ftp address where the files will be stored.
$ftpu = username for the ftp server.
$ftpp = password for the ftp server.
$serv = server name is simply a way of naming the files, ex: server1
- copy the script below, and paste it into the telnet/SSH window
- telnet into the server as admin
- gain root access, type su - and enter your root password
- type vi /backup.pl
- type i
- edit the "FTP Server Information here" variables in the Perl script (BELOW) to match your own:
$ftps = server name is the hostname or IP address of the ftp address where the files will be stored.
$ftpu = username for the ftp server.
$ftpp = password for the ftp server.
$serv = server name is simply a way of naming the files, ex: server1
- copy the script below, and paste it into the telnet/SSH window
#!/usr/bin/perl
#FTP Server Information here
$ftps = "10.10.10.10";
$ftpu = "bob";
$ftpp = "bobspass";
$serv = "myRemoteServer";
$ftps = "10.10.10.10";
$ftpu = "bob";
$ftpp = "bobspass";
$serv = "myRemoteServer";
system("/bin/tar cfp - /home | gzip |
/usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b
$serv-home.tar.gz");
system("/bin/tar cfp - /etc | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-etc.tar.gz");
system("/bin/tar cfp - /var | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-var.tar.gz");
system("/bin/tar cfp - /usr/admserv | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-admserv.tar.gz");
system("/bin/tar cfp - /usr/local | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-local.tar.gz");
system("/bin/tar cfp - /etc | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-etc.tar.gz");
system("/bin/tar cfp - /var | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-var.tar.gz");
system("/bin/tar cfp - /usr/admserv | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-admserv.tar.gz");
system("/bin/tar cfp - /usr/local | gzip | /usr/local/bin/ftpbackup -h $ftps -u $ftpu -p $ftpp -b $serv-local.tar.gz");
- type <ESC>wq
- type chmod 755 /backup.pl
- type chmod 755 /backup.pl
3) Now we need to put the back up script in the appropriate place.
If you would like the backup script to run daily, do this:
- type mv backup.pl /etc/cron.daily/backup.pl
If you would like the backup script
to run weekly, do this:
- type mv backup.pl /etc/cron.weekly/backup.pl
- type mv backup.pl /etc/cron.weekly/backup.pl
If you would like the backup script
to run monthly, do this:
- type mv backup.pl /etc/cron.monthly/backup.pl
- type mv backup.pl /etc/cron.monthly/backup.pl
4) You're done! The script should now run each day, week, month depending on which one you've choosen.
How do you restore it? Can't forget the other half of the deal...
Go into the new box you want to restore the data to... Hopefully this is the same box that you backed up from.
Go to the web interface using the
current password.
- Select "maintenance" and then "reboot." DO NOT CONFIRM the _javascript_ box yet.
- Select "maintenance" and then "reboot." DO NOT CONFIRM the _javascript_ box yet.
Upload your five files to
/home/sites/home/users/admin, and then follow the following instructions as
root.
Please replace the variable below ($serv) with the one you used (above).
Please replace the variable below ($serv) with the one you used (above).
cd /home
tar xvf /home/sites/home/users/admin/$serv-home.tar.gz
cd /etc
tar xvf /home/sites/home/users/admin/$serv-etc.tar.gz
cd /var
tar xvf /home/sites/home/users/admin/$serv-var.tar.gz
cd /usr/admserv
tar xvf /home/sites/home/users/admin/$serv-admserv.tar.gz
cd /usr/local
tar xvf /home/sites/home/users/admin/$serv-local.tar.gz
tar xvf /home/sites/home/users/admin/$serv-home.tar.gz
cd /etc
tar xvf /home/sites/home/users/admin/$serv-etc.tar.gz
cd /var
tar xvf /home/sites/home/users/admin/$serv-var.tar.gz
cd /usr/admserv
tar xvf /home/sites/home/users/admin/$serv-admserv.tar.gz
cd /usr/local
tar xvf /home/sites/home/users/admin/$serv-local.tar.gz
Go back to the web interface Select
"OK" to the _javascript_ message and you're done!
END
END
Cheers,
C
-----Original Message-----At 09:19 AM 03/11/2005, you wrote:
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of William J.A. Brillinger
Sent: 03 November 2005 21:51
To: Cobaltfacts mailing list
Subject: Re: [cobaltfacts] Quick RaQ 550 backups
Anyone got any ideas on how I can relatively quickly backup a raq 550
onto a seperate machine apart from using the commercial backup programs?
I've been trying cmuExport but the speed is quite awful for regular
backups.
TIA!
Sorry, I missed that you wanted to avoid CMU.
I used to do it this way (script follows) but I have found on my new BQ+Centos on a tyan 2.4ghz box CMU runs quickly - what used to take an hour now takes 8 min.
Here's my old script skipping CMU:
#!/bin/bash
# by William Brillinger, March 27, 2003
# create daily site backups for each site
d=$(date +%Y-%m-%d)
echo Removing Yesterdays Backup Files...
cd /home/daily_site_backups
rm *
echo
echo Start: $(date +%H:%M)
echo Backing Up Site Dirs...
for URL in $( find /home/sites -type l -maxdepth 1 | sed -e 's/\/home\/sites\///g' ); do
echo --Creating tar for $URL...
SiteNo=$(ls -l /home/sites/$URL | sed -e 's/.*\/sites\///g')
tar cpz -f $d-$URL-$SiteNo.tar.gz /home/sites/$SiteNo
echo
done
echo Backing Up MySQL DataBases...
mysqldump --all-databases --opt -uroot -pPASSWORD > $d-MySQL-Databases.sql
echo Databases Found...
echo grep 'CREATE DATABASE' $d-MySQL-Databases.sql | sed -e 's/.*\*\/ //g'
echo
echo Backing Up Email Spools...
tar cpz -f $d-MailSpool-.tar.gz /home/spool
echo
echo Securing files...
chmod 600 *
echo Transfering Files to Secure2...
# ------------------------------------------
# See ~/.netrc for login changes!!
# ------------------------------------------
ftp -i backup.server.tld <<**
cd /admin_tools/backups-hostname
mkdir $d
cd $d
binary
mput *
ls -x1A
cdup
chmod 600 $d
bye
**
echo Completed: $(date +%H:%M)
William J.A. Brillinger
Precision Design Co.
E-Mail: mailto:[EMAIL PROTECTED]
Web site: http://www.pdcweb.net
_______________________________________________ Cobaltfacts site list [email protected] http://list.cobaltfacts.com/mailman/listinfo.cgi/cobaltfacts
