Forums | MacLife

Wide is the new black

You are not logged in.

#1 2008-06-05 3:54 am

Light Speed
Doubter of Einstein
Registered: 2002-08-17
Posts: 3693

Rsync through SSH

I am running a CentOS 5.1 remote box and want to back it up to my local Mac.

Is the best way to do this with rsync through SSH? If so how does that handle the live DBs on the box during the backup?

Does rsync create a tar on the remote and then transfer that or are the files transferred as is to my local machine or are the files transferred and then put in a tar?

If left as files what happens to permissions?

If my server needs a bare metal restore will I be able to do it remotely from my backups?

Offline

 

#2 2008-06-05 6:44 pm

Miles
Now I fight for wisdom!
Administrator
From: Michigan
Registered: 2001-07-21
Posts: 4464
Website

Re: Rsync through SSH

Light Speed wrote:

I am running a CentOS 5.1 remote box and want to back it up to my local Mac.

I'm going to assume that this is a (virtual) server in a datacenter somewhere that you don't have physical access to, because that's what this sounds like.  If I'm wrong, please correct me.

Is the best way to do this with rsync through SSH?

Probably not, but if your options are limited than it might work well enough for your purposes.

If so how does that handle the live DBs on the box during the backup?

Very poorly.  The PostgreSQL folks suggest that you do an initial, inconsistent backup while the database is live, then shut down the database and back it up again; the second backup should be faster.  If turning off the databases for a while doesn't work, then you need a more sophisticated replication system.

Does rsync create a tar on the remote and then transfer that or are the files transferred as is to my local machine or are the files transferred and then put in a tar?

If left as files what happens to permissions?

It at no time creates a tarfile.  It uses a custom protocol that is able to do incremental backups over a network fairly efficiently, but if you're only running once, the effect is more or less as if it transferred the files one at a time. 

With the appropriate configuration (namely -a, the archive flag) it will preserve symbolic links, permissions, ownership, and modification times.

If my server needs a bare metal restore will I be able to do it remotely from my backups?

You can't do a full restore of the filesystem while using it as a boot volume.  If the server is borked, you're best off restoring to some standard configuration and then restoring the files that you need.  Backing up the entire volume is probably a waste of time and space.

Offline

 

#3 2008-06-05 6:54 pm

Light Speed
Doubter of Einstein
Registered: 2002-08-17
Posts: 3693

Re: Rsync through SSH

Thanks for the info miles!

Yes it's a VPS running in an OpenVZ VE at a DC.

For now I'll just stick with automated backup tools in Virtualmin/Webmin to back up my Vhosts/DBs and config to my local machine but I feel naked not backing up the system. What if there is an update that borks my system? How am I supposed to roll back? How do others with similar set up do this?

Offline

 

#4 2008-06-05 9:20 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9934
Website

Re: Rsync through SSH

Is it a managed server? Doesn't the host offer at replication or complete image service?


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#5 2008-06-05 10:14 pm

Gipetto
Yankee Doodle's noodle
Royal Wombat
From: People! Ahg!!
Registered: 2000-09-24
Posts: 9934
Website

Re: Rsync through SSH

Also, if there's that much data and its such a huge task to back up the database you might consider replication. Have the database replicate itself automatically that way you can take the 2nd server offline to do the backup while the other one chuggs away.

But as far as updates borking the system I'd make sure that whoever is managing the server has a good backup system in place. If its a managed server that should be part of the hosting fee. They should be able to restore to something no less than 24 hours old.


So, just when did this place get Private Messages? YIKES!

Gippy Pages  |  Fuzzy Coconut XHTML Widget | PuppyCam

Offline

 

#6 2008-06-06 12:01 am

Light Speed
Doubter of Einstein
Registered: 2002-08-17
Posts: 3693

Re: Rsync through SSH

Thanks Gipetto.

The manged bit is handled by
<----That guy smile

I'm a newbie but you gotta learn sometime and I'm doing pretty good so far!

The DBs are not huge with the biggest at about 50MB but it's for my online store which is my main business so it's not something I want to mangle the data due to a half assed back up routine. I will look into replication as that has been mentioned in other threads as a safe way to do it.

Offline

 

#7 2008-06-06 7:30 am

Booksley
Planely insane!
From: Toronto, Ontario
Registered: 2001-02-16
Posts: 4721

Re: Rsync through SSH

Light Speed wrote:

Thanks Gipetto.

The manged bit is handled by
<----That guy smile

I'm a newbie but you gotta learn sometime and I'm doing pretty good so far!

The DBs are not huge with the biggest at about 50MB but it's for my online store which is my main business so it's not something I want to mangle the data due to a half assed back up routine. I will look into replication as that has been mentioned in other threads as a safe way to do it.

http://www.postgresql.org/docs/8.1/static/backup.html

They list 3 different ways to handle back-up. I think the first is the best, personally.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson