Page 47 of 138 FirstFirst ... 3745464748495797 ... LastLast
Results 461 to 470 of 1375

Thread: Howto: Backup and restore your system!

  1. #461
    Join Date
    Aug 2005
    Location
    Bardstown, KY, USA
    Beans
    200
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Howto: Backup and restore your system!

    Care to point me in the direction of an rsync howto? It won't help me with my current problem, but it sounds ideal for future backups. I'm not so concerned with compression as I am with ease of restore.

  2. #462
    Join Date
    Nov 2007
    Beans
    505
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Howto: Backup and restore your system!

    I have been playing around with a script to automate backing up both / and /home. The script does the following things:

    1. Backs up / and /home to folders named /Root and /Home in the folder of your choice (set in the variables section).
    2. Names the files Backup-MMM-DD-YY-HH:MM:SS.tgz and Home-Backup-MMM-DD-YY-HH:MM:SS.tgz
    3. Deletes backups older than a time specified in the variables section. You can set different lengths of time to preserve root and home backups.


    It is easy to run this script regularly using cron.

    Code:
    #!/bin/sh
    
    PATH=/usr/ucb:/usr/bin:/bin; export PATH
    
    ##################################################################################################
    #                          The following variables may be defined below:                         #
    #                                                                                                #
    # BACKUP_LOCATION is the folder where backups should be saved; the default is /Backup            #
    # ROOT_TIME is the length of time, in days, to preserve backups of /; the default is 90 days     #
    # ROOT_TIME is the length of time, in days, to preserve backups of /home; the default is 90 days #
    ##################################################################################################
    
    # Variables
    
    BACKUP_LOCATION=/Backup
    ROOT_TIME=90
    HOME_TIME=90
    
    # Export the variables set in the previous section
    
    export BACKUP_LOCATION; export ROOT_TIME; export HOME_Time
    
    # Tar and gzip the folder /; exclude unnecessary folders such as /proc /lost+found /mnt /media /sys; exclude /home
    
    tar cvpzf $BACKUP_LOCATION/Root/Backup-$(date +"%b-%d-%y-%T").tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/media --exclude=/sys --exclude=/home /
    
    # Tar and gzip the folder /home; if you wish to exclude subdirectories, add the switch --exclude=/your_directory.
    
    tar cvpzf $BACKUP_LOCATION/Home/Home-Backup-$(date +"%b-%d-%y-%T").tgz /home
    
    # Delete backups older than the time specified in the variables section, then exit
    find $BACKUP_LOCATION/Root/*.tgz -mtime +$ROOT_TIME -exec rm {} \;
    find $BACKUP_LOCATION/Home/*.tgz -mtime +$HOME_TIME -exec rm {} \;
    exit
    Suggestions, corrections, etc. would be much appreciated. This is my first shell script.
    Intel P4 2.4GHz @ 2.8GHz, Asus P4B533, 512MB PC2100 DDR SDRAM, ATI All-in-Wonder Radeon 7500. Ubuntu 7.10 (Gutsy).
    When you get the help you need, please mark the thread [Solved].

  3. #463
    Join Date
    Sep 2007
    Beans
    57

    Re: Howto: Backup and restore your system!

    Superb, I'll have to give this a go next time im on my work's laptop.

  4. #464
    Join Date
    Dec 2007
    Beans
    90

    Re: Howto: Backup and restore your system!

    Would this be a good way to "clone" a system. I want to be able to image the install after I have done all the modifications that are needed such as having run the updates, setup the IPtables and installed the "plugins" that I needed.

    I would assume this would work if system A (where the image was made) was the same as system B. If the two systems were slightly different, would the OS (say distro 7.04) be able to recognize the different drivers needed and download them?

    I'm looking for an easy way to share a pre-configured router setup. It seems that installing the linux OS and then setting it up correctly to be a router isn't as easy as it is made out to be. So I thought that making an image of the system once it is up and running and then sharing it may make it easier for people to use.

    I'm looking for ideas and opinions here. Thanks.

  5. #465
    Join Date
    Sep 2007
    Beans
    57

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by tuproxy View Post
    Would this be a good way to "clone" a system. I want to be able to image the install after I have done all the modifications that are needed such as having run the updates, setup the IPtables and installed the "plugins" that I needed.

    I would assume this would work if system A (where the image was made) was the same as system B. If the two systems were slightly different, would the OS (say distro 7.04) be able to recognize the different drivers needed and download them?

    I'm looking for an easy way to share a pre-configured router setup. It seems that installing the linux OS and then setting it up correctly to be a router isn't as easy as it is made out to be. So I thought that making an image of the system once it is up and running and then sharing it may make it easier for people to use.

    I'm looking for ideas and opinions here. Thanks.
    Yes I imagine it will do that job well if the hardware was the same. You say they are but they have small differences? What exactly is different?

  6. #466
    Join Date
    Dec 2007
    Beans
    90

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by Nightwalker07 View Post
    Yes I imagine it will do that job well if the hardware was the same. You say they are but they have small differences? What exactly is different?
    Well, in XP if I swap the HD with the OS installed already, it will boot and use default drivers if the correct drivers aren't installed. The video will be 640x480 and it may use a generic NIC drive and a generic IDE or SATA driver.

    Will Ubuntu do the same thing if say the MOBO is different? I'm just wondering if a generic image can be made to be shared with similar machines.

    If system A has a differnet CD-Rom or different hard drives, will that be a problem?

  7. #467
    Join Date
    Oct 2007
    Beans
    832
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by tuproxy View Post
    Would this be a good way to "clone" a system. I want to be able to image the install after I have done all the modifications that are needed such as having run the updates, setup the IPtables and installed the "plugins" that I needed.

    I would assume this would work if system A (where the image was made) was the same as system B. If the two systems were slightly different, would the OS (say distro 7.04) be able to recognize the different drivers needed and download them?

    I'm looking for an easy way to share a pre-configured router setup. It seems that installing the linux OS and then setting it up correctly to be a router isn't as easy as it is made out to be. So I thought that making an image of the system once it is up and running and then sharing it may make it easier for people to use.

    I'm looking for ideas and opinions here. Thanks.
    I actually did something similar. I backed up my system. When all my parts came in for a new computer I was building, I built the computer and then restored the back-up files from the older machine. I upgraded MOBO, CPU, Video card, HD, and RAM. To be clear, I backed up my configuration files separately (xorg, fstab, etc..) and did not restore those files.

    My system booted up properly, but I did experience some quirky things when trying to use it that I couldn't explain or remember now.

    I decided to reinstall everything...

    My thought is that when installing the Ubuntu OS I know it configures itself to your hardware towards the end of the install, which could be a problem. That being the case, you could always install while NOT being connected to the Internet and then certain system configuration settings might not occur, but then you might have other issues with having to set repositories and such just to name one.

    One last thing... If I may RESPECTFULLY submit - this HowTo is good for a large percentage of users. However, using the Tar command suggested in the original post will eventually catch up with everyone and cause serious problems. I feel pretty confident saying it's not a matter of IF, but a matter of WHEN. That's not to say you would lose your data, but when 'WHEN' happens, you'll find you're going to have to do some research into getting a working OS and then how to restore your data.

    Please don't read this a me trying to hijack this thread, it's not my intent by any means. However, our back-ups are very dear to us, right? We do them to save our treasured things and also to help us get up and running much more quickly. I'm just looking out for your/everyone's best interests.

    I actually tried to contact the OP, but never heard back from him.

    If you're looking to continue backing up your system using Tar (very good method), then consider checking out my script below. If you decide to download it, you can read the Help file, which will give you an indication of why it might be better to do it a different way. Also, my script will give you a better chance of working when restoring to different machines as I do the back-up a bit differently.

    good luck...
    Last edited by mdpalow; December 16th, 2007 at 10:12 PM.

  8. #468
    Join Date
    Nov 2007
    Beans
    505
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by mdpalow View Post
    However, using the Tar command suggested in the original post will eventually catch up with everyone and cause serious problems. I feel pretty confident saying it's not a matter of IF, but a matter of WHEN. That's not to say you would lose your data, but when 'WHEN' happens, you'll find you're going to have to do some research into getting a working OS and then how to restore your data.
    What exactly do you mean? Exactly what problems do you foresee that the rest of us don't? Issuing cryptic warnings without any details doesn't help anyone.

    Furthermore, I've examined your script, and it uses essentially the same tar command, with just a few added exclusions. Why not just tell us your logic for those exclusions and why you think they're important?
    Last edited by thelatinist; December 16th, 2007 at 10:36 PM.
    Intel P4 2.4GHz @ 2.8GHz, Asus P4B533, 512MB PC2100 DDR SDRAM, ATI All-in-Wonder Radeon 7500. Ubuntu 7.10 (Gutsy).
    When you get the help you need, please mark the thread [Solved].

  9. #469
    Join Date
    Oct 2007
    Beans
    832
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Howto: Backup and restore your system!

    Sorry, I was in hurry to leave when I posted last.

    I wouldn't go as far as to say "what I see and the rest don't." However, I think a lot of new users will not see the problem.

    The problem lies in copying the configuration files into the system back-up. When doing this, you rope yourself into restoring these files along with the rest of the files being restored. Therefore, if you were to change some hardware after making a back-up, you put yourself in a bad position because the restore will copy the old configuration files into a computer that is using different hardware.

    So, if you were to change to a different video card and then restored the old xorg file, you could very well not have a display. Even worse might be to add a hard drive and then put the back-up on a different mount (ex: from sda1 to sdb1) and then the system doesn't boot at all because the configuration files no longer match the original system's configuration.

    For that reason, my script backs up the configuration files separately and allows the user to decide how they want to proceed with these files when restoring.

  10. #470
    Join Date
    Aug 2005
    Beans
    380

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by commonplace View Post
    Care to point me in the direction of an rsync howto? It won't help me with my current problem, but it sounds ideal for future backups. I'm not so concerned with compression as I am with ease of restore.
    There's a very basic strategy here. A fuller discussion and an ingenious technique to create rotating "snapshots" using rsync and hard links is here. (This is basically what I do for my backups.)

    I've never tried "dirvish", but it is rsync-based, and is in the repositories. It is mentioned in this thread.

Page 47 of 138 FirstFirst ... 3745464748495797 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •