Page 103 of 138 FirstFirst ... 35393101102103104105113 ... LastLast
Results 1,021 to 1,030 of 1375

Thread: Howto: Backup and restore your system!

  1. #1021
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by freeztar View Post
    Thanks!

    Ok, so I have:

    Code:
    tar --one-file-system -cvpzf /media/share_/UbuntuBackup`date +%F`.tgz --exclude=/lost+found --exclude=/media --exclude=/mnt /
    Look good? Any other suggestions or recommendations?
    I'd put a dash between UbuntuBackup and the date so the names are easier to read. You don't need to exclude lost+found either since it should never have anything in it anyhow, and --one-file-system takes care of excluding any other drives you may have mounted in /media or /mnt so no need to explicitly exclude those either. I also assume /media/share_ is another machine on the network or a removable disk or something.

    If you plan on making regular backups you might want to make use of incremental backups so that only the files that changed need to be backed up every day, then do a full backup once a week.

  2. #1022
    Join Date
    Feb 2008
    Beans
    31

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by psusi View Post
    I'd put a dash between UbuntuBackup and the date so the names are easier to read. You don't need to exclude lost+found either since it should never have anything in it anyhow, and --one-file-system takes care of excluding any other drives you may have mounted in /media or /mnt so no need to explicitly exclude those either. I also assume /media/share_ is another machine on the network or a removable disk or something.
    It's a FAT32 partition that I use for storage. I also back up files from XP there, so it makes it easier to backup everything from there to an external drive. As long as the tar doesn't include that partition, I'll take out that exclude for /media.

    If you plan on making regular backups you might want to make use of incremental backups so that only the files that changed need to be backed up every day, then do a full backup once a week.

    Good idea. I suppose I can work this into the script. I'm a newbie at writing ubu scripts, so if you know of any that I could download and modify, that would be better than reinventing the wheel. Some neat additions could be timestamp checking for overwrites and perhaps automated running at certain times/days.

    Thanks for your help! Hopefully others find use in this as well.

    Edit: Good resource here... https://help.ubuntu.com/8.04/serverg...llscripts.html ...which should be all I need.
    Last edited by freeztar; March 4th, 2010 at 03:54 AM. Reason: shown

  3. #1023
    Join Date
    Feb 2009
    Beans
    109

    Re: Howto: Backup and restore your system!

    Is the beginning of this guide still accurate and useable for 9.10 even though its 5 years old?

  4. #1024
    Join Date
    Feb 2008
    Beans
    31

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by Daremo_06 View Post
    Is the beginning of this guide still accurate and useable for 9.10 even though its 5 years old?
    The commands are the same. Though, subsequent posts have certainly refined it a bit. I'm using 9.10 and it created the file fine for me. My next step is to test the opposite process, but I'm a bit nervous about that part. It's a good exercise for that old desktop I suppose.

  5. #1025
    Join Date
    Feb 2010
    Beans
    1

    Re: Howto: Backup and restore your system!

    Good guide.Thanks.

    ________________________
    Lanzarote

  6. #1026
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Howto: Backup and restore your system!

    You might want to use NTFS instead of FAT32. IIRC FAT32 can't handle files larger than 4 GB. Here are the daily and weekly backup scripts I have running on my server via cron:

    Code:
    #!/bin/sh
    
    /etc/init.d/apache2 stop
    /etc/init.d/mysql stop
    
    tar czf /backup/`date +%F`-daily.tgz --exclude='/backup/*' --exclude='/proc/*' --exclude='/sys/*' --exclude='/tmp/*' --exclude='/dev/*' --exclude='/var/cache/*' -g/backup/backup.snapshot /
    cd /backup
    echo put `date +%F`-daily.tgz | smbclient //irisvr/devbackup\$ -Uusername password
    rm /backup/`date +%F -d '14 days ago'`-daily.tgz
    echo del `date +%F -d '14 days ago'`-daily.tgz | smbclient //irisvr/devbackup\$ -Uusername password
    /etc/init.d/mysql start
    /etc/init.d/apache2 start
    And weekly:

    Code:
    #!/bin/sh
    
    /etc/init.d/apache2 stop
    /etc/init.d/mysql stop
    
    rm /backup/backup.snapshot
    tar czf /backup/`date +%F`-full.tgz --exclude='/backup/*' --exclude='/proc/*' --exclude='/sys/*' --exclude='/tmp/*' --exclude='/dev/*' --exclude='/var/cache/*' -g/backup/backup.snapshot /
    cd /backup
    echo put `date +%F`-full.tgz | smbclient //irisvr/devbackup\$ -Uusername password
    rm `date +%F -d '14 days ago'`-full.tgz
    echo del `date +%F -d '14 days ago'`-full.tgz | smbclient //irisvr/devbackup\$ -Uusername password
    /etc/init.d/mysql start
    /etc/init.d/apache2 start
    You can ignore the apache and mysql parts since you probably aren't running those servers so they don't need shutdown and restarted after the backup. After the backup it also deletes the one made 2 weeks ago so I only have two weeks of backups at any one time. It also then uses smbclient to copy the backup file to another Windows server on the network.

  7. #1027
    Join Date
    Feb 2008
    Beans
    31

    Re: Howto: Backup and restore your system!

    Excellent! Thanks once again, psusi!

    I chose FAT32 because I was told by a Linux veteran that nix still has issues with NTFS, particularly if the partition is shared by both linux and Windows (something about how the data is written differently and fragmentation/overwrite issues, iirc - fwiw, I do have the ntfs ability in Ubu and have had no problems so far with sharing another partition that is NTFS). The 4GB limit is a bummer, but if that makes things more stable, it's a sacrifice I'm willing to endure. Of course, if there's no truth to this, then I'd be happy to know.

  8. #1028
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Howto: Backup and restore your system!

    There's no truth to it

    Ubuntu has had no problem using NTFS for a few years now.

  9. #1029
    Join Date
    Jan 2010
    Beans
    76

    Re: Howto: Backup and restore your system!

    i executed the line from the very first post and got this after it put everything into backup.tgz:
    Code:
    Exiting with failure status due to previous errors.
    what does this mean? because i see backup.tgz in my / folder. did it work or not?

  10. #1030
    Join Date
    Sep 2008
    Location
    Las Vegas, NV U.S.A.
    Beans
    240
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by sincerelyydavid View Post
    i executed the line from the very first post and got this after it put everything into backup.tgz:
    Code:
    Exiting with failure status due to previous errors.
    what does this mean? because i see backup.tgz in my / folder. did it work or not?
    its hard to say. i have used the method here from an external storage device using bzip2 with the file being written at the location on the external device where i wanted to store it.

    it ran for nearly 5 days and finished without error.

    this is the command i used from the directory on the external storage device where i wanted to create the backup file...

    Code:
    tar cvpjf backup.tar.bz2 --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.bz2 --exclude=/mnt --exclude=/sys --exclude=/home/storage/extern --exclude=/home/lost+found /
    this was a "complete" system back up of my primary storage on a server. i think the only thing i added was exclude /home/storage/extern (my external storage) and /home/lost+found.

    just run a similar command from the directory of an external storage device where you want to create the backup file. i believe this will eliminate the errors that some are reporting and thus remove the concerns some have about the backup file being usable.

    don't forget to exclude your external storage from the backup i think the errors are caused by the presence of the open file in the same tree the backup is being run on.

    good luck!

Page 103 of 138 FirstFirst ... 35393101102103104105113 ... 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
  •