[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] Backing up with tar and gzip
- Subject: RE: [cobalt-users] Backing up with tar and gzip
- From: aljuhani <aljuhani@xxxxxxxxx>
- Date: Wed Feb 5 07:24:01 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
Here is a Raq backup script from someone on WebHostingTalk.com. Because the
URL is very long Full message is quoted below:
--Quote--
Hello!
Let me tell ya, I've had my share of hard drive failures and hack attempts
leaving me without a useable system. So what happens? Well the system is
restored to OS, patches are installed, and I "restore" the system with the
handy little .raq file that I downloaded every day. WRONG, actually, you
create every site and username in the order in which they were created and
then you hit "Restore" only to find "unkown error" on every single file. So
what next? Well you notify your clients and let them know that they need to
reupload everything (making them very unhappy). I have had more then enough of
this situation, and I've finally taken advice from others and setup a back up
system THAT WORKS! It will backup everything essential to restoring the server
to functional state with all site files, etc!
Before I give you the instructions, I would like to thank "webbcite" for his
helpful ftpbackup commands, and of course the notorious Cobalt-Users group for
the many posts reassuring everyone that this *does* work.
In a nutshell... The system utilizes ftpbackup and a perl script run via cron.
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/f...ckup-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 pico -w backup.pl
- copy the script below, and paste it into the telnet window
#!/usr/bin/perl
#FTP Server Information here
$ftps = "server name here";
$ftpu = "username here";
$ftpp = "password here";
$serv = "server name";
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");
-edit the "FTP Server Information here" variables to match your own (server
name is the hostname or IP address of the ftp address where the files will be
stored, username and password are for the ftp server, and server name is
simply away of naming the files, ex: server1)
- exit pico hold Control-X
- answer yes to save changes
- 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
If you would like the backup script to run monthly, do this:
- 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 choose.
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, I believe that it will have to be the same
kind (ex, RaQ3 instead of RaQ4).
Upload your five files to /home/sites/home/users/admin, and then follow the
following instructions as root. Please replace $serv with the one you used.
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
Go to the web interface using the password from the old box. Select
"maintenance" and then "reboot." Reboot the system and you're done.
Please keep in mind that if you choose to use this, it is at your *own* risk.
I cannot be held responsible should something go wrong.
Good luck!
__________________
Brandon Keim
--Un-Quote--
Al-Juhani
aljuhani@xxxxxxxxx
>===== Original Message From cobalt-users@xxxxxxxxxxxxxxx =====
>> Message: 15
>> From: "=?iso-8859-1?Q?Jos=E9_Luis_Chafardet_G.?="
><joseluis@xxxxxxxxxxxxxxxx>
>> To: <cobalt-users@xxxxxxxxxxxxxxx>
>> Subject: RE: [cobalt-users] Backing up with tar and gzip
>> Date: Tue, 4 Feb 2003 23:25:16 -0400
>> Organization: DGTal Studios Information Communication & Design Integrated
>Solutions
>> Reply-To: cobalt-users@xxxxxxxxxxxxxxx
>>
>> >take a look at #tar --help
>> >you'll see that the v stands for verbose,
>> >-v, --verbose verbosely list files processed
>>
>> >So the command would be something like...
>>
>> >tar -cf backupufile.tar somedir
>>
>>
>> >Paul ASI
>>
>> >sig--
>> >Developers of www.ourfaqsite.com
>> >Your faqs are your own business
>>
>> Thanks, now there is any way to create in 1 steep a tar.gz ? without to
>> do tar -cf file.tar somedir
>> And
>> Gzip -cr9 "CANTREMEMBER" file.tar