[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] Help with backup scripts, please
- Subject: RE: [cobalt-users] Help with backup scripts, please
- From: "Paul Alcock" <webmgr@xxxxxxxxxxxxxxxxxx>
- Date: Fri Apr 19 07:48:46 2002
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> > I can't find a decent backup solution for my Raq2 so I am going
> to try to
> > write a script to tar the information and I'll have a server FTP and
> > download the file. However, I am not sure all directories I should
> backup.
> >
> >
> > What other files/directories would I back other than:
> > /home/sites/
> > /home/spool/
> > /home/mysql/
> > /root/
> > /etc/httpd/conf/
> >
>
> Chad-
>
> Don't forget to kill mysqld just prior to backing up this dir tree and
> restart when you're done (unless you don't expect writes to
> happen or are Ok
> with potentially corrupt dbs on occasion when this happens).
Here's a script I modified that works fine, just add lines to
also backup the root, spool and mysql etc.
#!/usr/bin/perl
#-----------------------------------------------------------------
# Tar site files and send to backup server
#-----------------------------------------------------------------
$FileNames= '/home/sites/';
open(FIND, "find $FileNames* -maxdepth 0 -type d -print |");
while (<FIND>){
chomp($_);
$Target='RAQ2_'.$_.'.tar';
$Target=~ s#/home/sites/##;
print "Processing SiteDirectory = $_ to $Target\n";
system "tar cXfp excludefiles - $_ | ftpbackup -h MYP-CIP-ADD-RES -u
MYFTPUSERNAME -p MYFTPPASSWORD -b $Target ";
}
close(FIND);
print "All Sites backed up.\n\n";
$Target='RAQ2_etc.tar';
$Source='/etc';
print "Processing /etc $Target\n";
system "tar cXfp excludefiles - $Source | ftpbackup -h MYP-CIP-ADD-RES -u
MYFTPUSERNAME -p MYFTPPASSWORD -b $Target ";
#note, the system "tar.... "; lines should be on a single line of code not
split as probably happens in this post.
I use G6FTP available from www.gene6.com as the local ftp server on my pc.
Simply run the ftp server and setup the myftpusername and myftppassword and
give it write access to a directory where you want to store all of the
backup files.
Start the ftp server.
Start your SSH client on the raq log and su to root.
run the script from the /home/sites directory and watch it all happen.
I have had need to do a restore and it went without a hitch.
Even had to restore to a new machine (after adding site and user accounts)
Hope it helps.
Paul A.
Authors of
www.ourfaqsite.com