Swimminginthought

A place for all things technical and my mind..

Menu
  • About Me / Hire Me
Menu

Backup your Linux Server configuration for a really fast restore

Posted on April 27, 2012 by Percy Kwong

Every once in a while, we have to build a server.  You’ve spent the time installing and configuring everything and you want a snapshot for Posterity’s sake.  Here’s how to do it quickly.  This little command will simply take a snapshot of everything of importance and for the most part allow you to restore your server from a fresh install (binaries, libs, and all) in a few minutes.

I do this for every one of my servers.  Especially my EC2 Instance Backed servers.

I keep an EBS volume around that I mount as /mnt for hot attaching to any server and doing the restore.  So basically, Just hot attach the EBS volume and just untar it.  Restart all the services and you’re done.  Keep in mind that if you’re running services, they should be shut down prior to issuing this command.

The beauty of this is it allows you to keep things separate.  (Applications, Binaries, and Data)

I exclude any data as that is backed up to S3 on a regular schedule, but the configs, binaries, libraries are all preserved using this method.

The magic tool?  Tar.

I issue the following command:
tar czvf /mnt/total/restore.tgz --exclude "/proc" --exclude "/sys" --exclude "/net" --exclude "/root/Archives.tar" --exclude "/usr/src/backup" --exclude "/media" --exclude "/home/backup" --exclude "/mnt" --exclude "/dev" --exclude "/home/vmail" /

It’s pretty self explanatory.  I’m pretty much tarring up everything except for anything that would cause problems like /proc /sys /net and certain data directories.

Simple tip, but great solution to a really quick restore of an Amazon Instance Backed linux box or even any linux box.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Kubernetes install gotcha on CentOS-7.x
  • Infrastructure as Code using AWS Cloudformation
  • Does SSL matter? It does and it’s not just web encryption.
  • Apache can’t serve the .well-known directory
  • Cloudy with a chance of Meatballs
  • Resurrection of the Blog
  • Encryption type Matters with Deep Packet Inspection – solved
  • Completely off topic.. Just a personal note.

Recent Posts

  • Kubernetes install gotcha on CentOS-7.x
  • Infrastructure as Code using AWS Cloudformation
  • Does SSL matter? It does and it’s not just web encryption.
  • Apache can’t serve the .well-known directory
  • Cloudy with a chance of Meatballs

Recent Comments

  • Percy Kwong on Boosting Octane Yourself. I did the research, made it, and proved it.
  • Nick Doelman on Boosting Octane Yourself. I did the research, made it, and proved it.
  • Percy Kwong on International Text solutions – A solution
  • Muzahid Ul Islam on The Browser Wars; Which One is Best?
  • Muzahid Ul Islam on International Text solutions – A solution

Archives

  • September 2019
  • August 2019
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • August 2011
  • June 2011
  • March 2011
  • February 2011
  • November 2010
  • October 2010
  • September 2010
  • July 2010
  • January 2010
  • November 2009
  • October 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008

Categories

  • Activism
  • All
  • Amazon S3
  • Announcements
  • Apache
  • Apple
  • Applications
  • Automation
  • AWS
  • Azure
  • Backups
  • Blogging
  • Books
  • Bootcamp
  • CentOS – RHEL
  • Cloud Computing
  • Cloudformation
  • Consulting Advice
  • Craigslist
  • Databases
  • Deep Packet Inspection
  • Doing the right thing
  • e-Book Readers
  • E-Mail
  • EC2
  • energy-efficiency
  • environment
  • Expose
  • firewalls
  • General Observations
  • Hardware
  • Hope
  • Hosting
  • IaC
  • Important things to do in life
  • Infrastructure as Code
  • Kubernetes
  • Linux
  • Media and Encoding
  • Miscellany
  • Mobile Phones
  • MySql
  • Networking
  • Performance
  • Personal
  • pfsense
  • Politics
  • Privacy
  • Redundancy
  • Routers
  • security
  • SPAM
  • Tech that doesn't work like it should
  • Tips and Tricks
  • Tools that work
  • Tout
  • Video
  • Virtual Computing
  • VOIP-Voice Over IP
  • VPN
  • Web Browsers
  • Web Hosting
  • Websites
  • Windows
  • Wordpress

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2026 Swimminginthought | Built using WordPress and Responsive Blogily theme by Superb