LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-18-2005, 10:26 PM   #1
Terroth
Member
 
Registered: Mar 2004
Posts: 47

Rep: Reputation: 15
Full system backup.


Hey guys, I was wondering what is the best way to do a remote full system backup? I want to clone my current drive onto a second drive basicly. Would .tar.gzing the drive to the 2nd work? Remember, I only have remote access.
 
Old 06-18-2005, 10:31 PM   #2
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Rep: Reputation: 30
yep. you would need ample hard drive space but you should be able to ssh into the system and issue somehting like

cd /
tar -cvvf /dev/otherdrive/backup.tar /
then
bzip2 it.

i would use bzip2 cause it compresses more and has no loss. it is newer and better. then if you need to untar it use
tar xvjpf whatever.

that would do it i do it all the time to my mail servers.
 
Old 06-18-2005, 10:32 PM   #3
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Rep: Reputation: 30
by the way. i said tar -cvvf cause the 2 v's mean very verbose. it will actually print onto your shell what files it is adding to the archive so that you know it is working.
 
Old 06-18-2005, 10:45 PM   #4
doctor_sniff
LQ Newbie
 
Registered: Aug 2003
Location: Iran
Distribution: GNU Linux
Posts: 24

Rep: Reputation: 15
Hey Terroth.
I wrote a simple backup script with bash.
you can use it for your system.
--------------------------------------------------------------
cd /home/httpd/vhosts/farsilinux.org/httpdocs/backups
Name=`date +%Y-%m-%d`
mkdir $Name
cd $Name
mkdir DB FILE
cp -dfrp /var/lib/mysql/fxnuke/* DB
cp -dfrp /home/httpd/vhosts/farsilinux.org/subdomains/portal/httpdocs/* FILE
cd ..
tar -cvzf $Name.tar.gz $Name
if test -s $Name.tar.gz
then
gpg -e -r backup $Name.tar.gz
echo "Backup $Name is Created. You Can receive it in this address: http://www.farsilinux.org/backups/$Name.tar.gz.gpg"|mail backup@farsilinux.org -s Date:$Name
if test -s $Name.tar.gz.gpg
then
rm -dfr $Name.tar.gz
fi
rm -dfr $Name
else
exit
fi
-----------------------------------------------------
run it and enjoy.
 
Old 06-19-2005, 12:51 AM   #5
Terroth
Member
 
Registered: Mar 2004
Posts: 47

Original Poster
Rep: Reputation: 15
Very nice script indeed. I heard that backing up drives remotely via taring it will miss files?

When you said ample space, how much space? The same exact ammount? Or do I need more then the partition? Im backing up a 37Gig SCSI to my other harddrive which is split into two, a 40 gig partion, and the rest for personal storage.
 
Old 06-19-2005, 02:04 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
How about skipping intermediate steps? :}

Boot the target box of a knoppix CD, and
issue (from the mounted target drive):
rsync -Save ssh root@remotebox.com:/*


Cheers,
Tink
 
Old 06-19-2005, 02:42 AM   #7
Terroth
Member
 
Registered: Mar 2004
Posts: 47

Original Poster
Rep: Reputation: 15
I have no access to the CD-Rom.
 
Old 06-19-2005, 02:47 AM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Sorry - I thought you wanted to get the remote box to
a local system. If both drives live on the remote server
you can use rsync there ;}


Cheers,
Tink
 
Old 06-19-2005, 03:08 AM   #9
doctor_sniff
LQ Newbie
 
Registered: Aug 2003
Location: Iran
Distribution: GNU Linux
Posts: 24

Rep: Reputation: 15
if you want to use sync, you can use this command with this option:
frist run rsync service and run this code.
rsync -avz /var/www/html/ /Lab/PHP

and save thid commad to a file and move it to (e.g /etc/cron.hourly)
 
Old 06-19-2005, 06:12 AM   #10
Ikebo
Member
 
Registered: Jun 2004
Location: Michigan, USA
Distribution: Ubuntu
Posts: 77

Rep: Reputation: 15
rdiff-backup is a good tool for this situation as well.
 
Old 06-20-2005, 06:26 PM   #11
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Rep: Reputation: 30
na it wont corrupt anything. at least not in my experience. ever. so. just ssh in and it is like you are there on the console. as far as space the initial tar file will be huge. when you bzip2 it it will be alot smaller. i have heard of even like 30% smaller. but some files are already shrunk so.. you know. the script above looks pretty nice too. i wont use ill rely on old faithful, but you could giver a try.
 
Old 06-21-2005, 12:52 AM   #12
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
Try with rsync -avzl option.
This will preserve all the links also. If there is a symblink to a particular directory, it will copy that as it is without copying the data to where the link specifies.

-Prasanta
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Full System Backup from network froggo Linux - Newbie 1 05-19-2005 02:03 PM
full System Backup czezz Linux - Software 10 05-08-2005 01:50 PM
Full system backup Suse Personal 9.1 markbaravelli Suse/Novell 4 11-13-2004 03:26 PM
Full Backup.... LinuxBie Linux - Newbie 3 01-02-2004 10:43 AM
full system backup dbc254 Linux - General 6 12-26-2003 09:27 PM


All times are GMT -5. The time now is 12:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration