Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Question about Backups
PostPosted: Wed May 15, 2013 9:00 pm 
Offline
Newbie

Joined: Thu Oct 11, 2012 12:26 am
Posts: 3
Does the backup service backup data only (files, db) or does it backup the entire disk image? I guess what I'm getting at is - when you restore from a backup, will the server configuration come along with the backup? Or will I have to re-configure everything before restoring?


Top
   
PostPosted: Wed May 15, 2013 9:19 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
A backup includes all disk images and configuration profiles, so when you restore, you get them all back (and in fact, can't select a subset, it's always the entire thing).

Technically, the disk image backups themselves are file based, so you need to stick with a supported filesystem (e.g., create the image via the Linode Manager) or else the backup system won't be able to function.

Essentially it supports a "bare metal" (or bare VPS) restoration (and in fact does not support per-file restorations). If you were to create a new Linode, restore a backup, and then boot the configuration profile, your Linode would be back to the same complete state it was in as of the backup.

When you restore, the restoration configurations/images are all given a prefix of "Restore ####" so you can restore to an existing Linode as long as you have space, and then make any adjustments you may wish. The disk images will be only slightly larger than needed for their files, so not their exact original size, but you can expand them afterwards. That also helps with a restoration potentially fitting on a Linode that already has a configuration.

-- David


Top
   
PostPosted: Wed May 15, 2013 10:11 pm 
Offline
Newbie

Joined: Thu Oct 11, 2012 12:26 am
Posts: 3
Thanks for the info.


Top
   
PostPosted: Wed May 15, 2013 10:29 pm 
Offline
Senior Member

Joined: Tue Feb 19, 2008 10:55 am
Posts: 164
you should still dump your database every day.

here's my script to do that, cron runs it every morning
Code:
#!/bin/bash

for a in `seq 8 -1 0`; do
        mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2
done

/usr/bin/mysqldump --events --all-databases > /var/backups/mysql/mysqldump.sql.0
/bin/bzip2 -9 /var/backups/mysql/mysqldump.sql.0


that will keep about 10 copies of your database on disk, so if it's a large database, it might not fit. you can change seq 8 -1 0 to (eg) seq 3 -1 0 to keep about 4 copies.


Top
   
PostPosted: Wed May 15, 2013 11:43 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
chesty wrote:
Code:
#!/bin/bash

for a in `seq 8 -1 0`; do
        mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2
done


FWIW, in bash you can replace most uses of 'seq' with brace expansion - even if spawning an extra process is no problem, it may be easier to read. Your first line would look like:
Code:
for a in {8..0}; do


Also note the square bracket syntax for arithmetic expansion is deprecated in favor of $(( ... )). There don't seem to be any plans to remove the older syntax, but something to keep in mind when writing new scripts.


Top
   
PostPosted: Thu May 16, 2013 3:22 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Also note that mysqldump locks databases/tables which will effect your application. If you're using innodb you can run mysqldump --single-transaction and it'll run the entire dump in a single transaction and not lock your database/tables.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu May 16, 2013 1:50 pm 
Offline
Senior Member

Joined: Sat Jun 05, 2004 12:49 am
Posts: 333
Or if you're using myisam you can just cp the files, it's how mysqlhotcopy works.


Top
   
PostPosted: Sun Aug 04, 2013 10:30 pm 
Offline
Senior Newbie

Joined: Thu Jun 24, 2010 10:07 am
Posts: 18
What are the downsides of utilising --single-transaction?


Top
   
PostPosted: Mon Aug 05, 2013 5:12 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
shippinpie wrote:
What are the downsides of utilising --single-transaction?

None apart from it only works with innodb.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group