Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • Last Modified:

How do I create backups and restore a linux server on AWS EC2?

I have one LAMP Linux box in Europe on EC2. I would like to be able to take Weekly and Nightly diff backups that overwrite themselves and be able to restore it if any disaster occurs. 2 backups files (weekly and a daily image)
  • 2
2 Solutions
#! /bin/bash
WEEKDAY=`i/usr/bin/date +%w`

cd «basedirectory»
tar -czf $BACKUPDIR/backup.$WEEKDAY.tar.gz «filename list»

# This script produces a different backup archive for each weekday
# If you want to overwrite the single days but keep only one "Week"-File and
# one "Day"-File th is overwritten daily, it's like

cd «basedirectory»
if [  $WEEKDAY == 1 ]; then
   tar -czf $BACKUPDIR/backup.weekly.tar.gz «filename list»
   tar -czf $BACKUPDIR/backup.daily.tar.gz «filename list»
concern_supportAuthor Commented:
Thanks brb6708, nice script but this isn't a full image backup. I may use it though in conjunction with the S3 solution.

Thanks fluk3d, I've seen these solutions but find them tricky and a little cumbersome.

AWS would do well to create a backup service...
it's up to you, which command you use.  just replace tar commands by suitable s3 commands.....
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now