Results 1 to 2 of 2

Thread: Backup Personal Configuration Files

  1. #1
    Join Date
    Feb 2006
    Beans
    28
    Distro
    Ubuntu 8.04 Hardy Heron

    Backup Personal Configuration Files

    After I had couple of system crashes, my GNOME configuration were not usable anymore (corrupted files). After number of attempts I've deleted GNOME configuration just to be able to login, I had to reconfigure many applications (Evolution, Network Manager, Nautilus, etc.)
    I've decided to write a small script to backup important files. First of all, I've created .backup directory.
    Code:
    mkdir  ~/.backup
    Then, in .backup directory I've created a file which contain the list of directories needed to backup.
    Code:
     gedit ~/.backup/backup.list
    Code:
    .config
    .gconf
    .gconfd
    .gnome2
    .gnome2_private
    .gnupg
    .evolution
    .nautilus
    Finally, a small bash script to create compressed tar archive
    Code:
    gedit ~/.backup/backup.sh
    Code:
    #!/bin/bash
    
    # create backup prefix and suffix using date command
    preffix=$(date +%F) # %F   full date (same as %Y-%m-%d)
    suffix='.tar.gz'
    
    # create backup using compressed tar
    tar pzcf ~/.backup/$preffix\_backup$suffix -T ~/.backup/backup.list
    That's it.
    To use the script, all you have to do is to make it executable
    Code:
    chmod +x .~/.backup/backup.sh
    and run it
    Code:
    ~/.backup/backup.sh
    If someone has know which other directories need to be backed up, please...

  2. #2
    Join Date
    Jun 2005
    Location
    Coimbatore, India
    Beans
    182
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: Backup Personal Configuration Files

    Assuming that personal config files all start with dot (.) as their first character and a letter as the second character, if instead of
    Code:
    tar pzcf ~/.backup/$preffix\_backup$suffix -T ~/.backup/backup.list
    you had
    Code:
    tar pzcf ~/.backup/$preffix\_backup$suffix ~/.[a-z][A-Z]*
    I think it would be more comprehensive.

    This solution is not foolproof because directories like .mozilla/firefox, and .mozilla-thunderbird, contain more than configuration information. Exclude whatever is unnecessary by using the
    Code:
    --exclude=PATTERN
    option.

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
  •