Essential backup directories

Ask a Question related to Ubuntu, Design and Development.

  1. #1

    Default Essential backup directories



    Hi all

    Fairly new to Debian/Ubuntu server and wanting to backup the essential
    directories (with rsync and cron or possibly compressed) to a smaller backup
    disk so that, if the worst happens, a system rebuild won't be too painful.

    The obvious ones are:

    /etc

    /home

    /usr/local

    ...but are there any others that I should know about? Particularly thinking
    about the apt-get database etc. Would like to be able to use apt-get and
    related tools to rebuild the whole system setup as easily as possible.

    Feel free to CC direct to my email - TIA

    Michael


    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

    _/ _/ _/_/_/ Hopkins Research Ltd
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ [url]http://www.hopkins-research.com/[/url]
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


    Michael Hopkins Guest

  2. Similar Questions and Discussions

    1. The book on essential systems administration
      Hi, all: As a student of the system administration field, which I'm hoping to get into that field with certification, classes, practice, I came...
    2. Essential Perl Modules
      I've been developing small scripts in Perl for a while now, and would like to think that I have a pretty good grasp of the fundamentals. I've...
    3. Using virtual directories for common directories (scripts, images, styles, etc.)
      Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of...
    4. essential extensions- php?
      Hi All Keeping in mind that I'm a beginner at using DMX with php/mysql, what are the basic/essential extensions I should install? So far I've...
    5. loop - begin backup, end backup Oracle 8.1.7
      Hello, we have the problem named after: last weekend (22.12.2002), we did a reorganisation of a tablespace with the tool "sapdba" from SAP....
  3. #2

    Default Re: Essential backup directories

    Michael Hopkins wrote:
    >
    > ..but are there any others that I should know about? Particularly thinking
    > about the apt-get database etc. Would like to be able to use apt-get and
    > related tools to rebuild the whole system setup as easily as possible.
    >
    A trick I use is to copy the contents of /usr/local to /home/local and
    then replace /usr/local with a symlink to /home/local. Search paths work
    as usual because the search crosses symlinks. Doing this gives one less
    directory structure to back up and stops a fresh install from
    overwriting it. In any case /usr/local contains a set of empty
    directories after the installation of every distro I've seen.

    Depending on what packages you have installed and which distro you're
    using you may want to back up at least part of /var too. In FC4 the
    following are held in /var:

    - mailboxes filled by sendmail or postscript are in /var/spool/mail
    - the root of Apache's HTML storage structure is in /var/www
    - named's zone files are in /var/named


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
    Martin Gregorie Guest

  4. #3

    Default Re: Essential backup directories

    ["Followup-To:" header set to alt.os.linux.debian.]
    On Sat, 06 May 2006 14:43:04 +0100,
    Michael Hopkins <michael.hopkins@hopkins-research.com> wrote:
    >
    >
    > Hi all
    >
    > Fairly new to Debian/Ubuntu server and wanting to backup the essential
    > directories (with rsync and cron or possibly compressed) to a smaller backup
    > disk so that, if the worst happens, a system rebuild won't be too painful.
    >
    > The obvious ones are:
    >
    > /etc
    >
    > /home
    >
    > /usr/local
    >
    > ..but are there any others that I should know about? Particularly thinking
    > about the apt-get database etc. Would like to be able to use apt-get and
    > related tools to rebuild the whole system setup as easily as possible.
    Though it changes infrequently, I'd add /boot if you use grub.

    You'll definately want /var, though not necessarily all of it's
    subdirectories.

    Michael C.
    --
    [email]mcsuper5@usol.com[/email] [url]http://mcsuper5.freeshell.org/[/url]

    Most people are dumb as bricks; some people are dumber than that. -- Lyle
    Michael C. Guest

  5. #4

    Default Re: Essential backup directories

    On Sat, 06 May 2006 14:43:04 +0100, Michael Hopkins wrote:

    > Fairly new to Debian/Ubuntu server and wanting to backup the essential
    > directories (with rsync and cron or possibly compressed) to a smaller backup
    > disk so that, if the worst happens, a system rebuild won't be too painful.
    It may be one companies marketing, but there is much wisdom at;

    [url]http://www.taobackup.com/[/url]

    If your backup system really has too little capacity, and you can't afford
    better, perhaps the question should be "which directories/files can I
    safely omit".

    As long as the machine is always patched up to date, any file that
    matches its checksum stored in the deb, can be easily restored from the
    original source media. Although this does make several assumptions about
    the environment you wish to restore it in, such as access to the source
    media (so often the Internet these days).
    Simon Waters Guest

  6. #5

    Default Re: Essential backup directories

    I demand that Simon Waters may or may not have written...

    [snip]
    > If your backup system really has too little capacity, and you can't afford
    > better, perhaps the question should be "which directories/files can I
    > safely omit".
    /dev
    /proc
    /sys
    /tmp
    /var/backups (probably)
    /var/cache
    /var/games (probably)
    /var/lock
    /var/log (maybe keep files whose names don't end in .gz or a number)
    /var/run
    /var/spool
    /var/tmp

    And the content of any directory which is immediately below a mount point and
    is named lost+found.

    [snip]
    --
    | Darren Salt | d @ youmustbejoking,demon,co,uk | nr. Ashington, | Toon
    | RISC OS, Linux | s zap,tartarus,org | Northumberland | Army
    | Say NO to UK ID cards. [url]http://www.no2id.net/[/url]

    Daddy, what does "Formatting drive C:" mean?
    Darren Salt Guest

  7. #6

    Default Re: Essential backup directories

    On Sat, 06 May 2006 14:43:04 +0100, Michael Hopkins wrote:
    >
    >
    > Hi all
    >
    > Fairly new to Debian/Ubuntu server and wanting to backup the essential
    > directories (with rsync and cron or possibly compressed) to a smaller backup
    > disk so that, if the worst happens, a system rebuild won't be too painful.
    >
    > The obvious ones are:
    >
    > /etc
    >
    > /home
    >
    > /usr/local
    >
    IMHO - /home is the essential one. Doing another install is a trivial task.

    ray Guest

  8. #7

    Default Re: Essential backup directories

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.3 (GNU/Linux)

    iD8DBQFEXStkVcFcaSW/uEgRAsDQAKC/y848CZYrr5KJP6ipgUycI5pB/wCeLXsv
    i2QnhuIHyypPbSfvYq63bxI=
    =IWWI
    -----END PGP SIGNATURE-----
    Roger Leigh Guest

  9. #8

    Default Re: Essential backup directories

    On Sat, 06 May 2006, Martin Gregorie spake:
    > Michael Hopkins wrote:
    >>
    >> ..but are there any others that I should know about? Particularly thinking
    >> about the apt-get database etc. Would like to be able to use apt-get and
    >> related tools to rebuild the whole system setup as easily as possible.
    >>
    > A trick I use is to copy the contents of /usr/local to /home/local and
    > then replace /usr/local with a symlink to /home/local. Search paths
    > work as usual because the search crosses symlinks. Doing this gives
    > one less directory structure to back up and stops a fresh install from
    > overwriting it. In any case /usr/local contains a set of empty
    > directories after the installation of every distro I've seen.
    I'd use mount --bind rather than a symlink, myself: find(1) and many
    other tools do not cross symlinks without explicit request.

    --
    `On a scale of 1-10, X's "brokenness rating" is 1.1, but that's only
    because bringing Windows into the picture rescaled "brokenness" by
    a factor of 10.' --- Peter da Silva
    Nix Guest

  10. #9

    Default Re: Essential backup directories

    ray <ray@zianet.com> wrote:
    > On Sat, 06 May 2006 14:43:04 +0100, Michael Hopkins wrote:
    >> Fairly new to Debian/Ubuntu server and wanting to backup the essential
    >> directories (with rsync and cron or possibly compressed) to a smaller backup
    >> disk so that, if the worst happens, a system rebuild won't be too painful.
    >>
    >> The obvious ones are:
    >>
    >> /etc
    >> /home
    >> /usr/local
    >
    > IMHO - /home is the essential one. Doing another install is a trivial task.
    "/etc" is useful for saving all those configurations you have spent
    *hours* perfecting. I would get an external USB disk and make regular
    copies of all my partitions.

    I do this and also have multiple copies on DVD of *really* important
    stuff like my digital photographs stashed in various locations.

    --
    Stephen Chadfield
    [url]http://www.chadfield.com/[/url]
    Stephen Chadfield Guest

  11. #10

    Default Re: Essential backup directories

    On Sun, 07 May 2006 00:04:01 +0100, Roger Leigh wrote:
    > ray <ray@zianet.com> writes:
    >
    >> On Sat, 06 May 2006 14:43:04 +0100, Michael Hopkins wrote:
    >>>
    >>> Fairly new to Debian/Ubuntu server and wanting to backup the
    >>> essential directories (with rsync and cron or possibly compressed)
    >>> to a smaller backup disk so that, if the worst happens, a system
    >>> rebuild won't be too painful.
    >>
    >> IMHO - /home is the essential one. Doing another install is a trivial task.
    >
    > It's not usually trivial. On a system that has been in any real use
    > for any length of time, there will be endless customisations you'll
    > have made, lots of extra software installed, and recreating the old
    > setup from scratch will be difficult, since the base install will need
    > a lot of work. As a result, you'll need to save /etc and the package
    > manager's package list in order to recreate it. Some parts of /var
    > are also useful here in some cases (e.g. PostgreSQL databases).
    >
    > For user data, you'll need /home, but nowadays you'll also likely need
    > to backup /srv as well for your system's data (databases, websites,
    > shared data, CVS/SVN/TLA/BZR RCS data, chroots, etc.)
    >
    >
    > I back up:
    > $(dpkg --get-selections)
    > /etc
    > /home
    > /srv
    > /var/lib
    >
    > I blat it over the network onto a set of Zip discs, since I don't have
    > a tape drive.
    >
    > To back up to another system, rsync is OK. You might want to look at
    > Amanda backup to tape if you want a decent backup system.
    >
    >
    > Regards,
    > Roger
    A few months ago I had a hard disk go bad. The entire sequence of events
    that followed consisted of:

    1) get a new disk and install.
    2) install Elive to new disk.
    3) boot Elive - and copy needed partitions from hard disk -
    basically the entire distro from two different installs - to files on the
    new disk.
    4) mount partition copies on loop device to check for data retrieval - all
    there.
    5) add Ubuntu and complete set-up. I had been running Mandrake and was
    going to be doing an upgrade soon anyway.


    ray Guest

  12. #11

    Default Re: Essential backup directories

    On 7/5/06 16:01, in article [email]pan.2006.05.07.15.01.33.728604@zianet.com[/email], "ray"
    <ray@zianet.com> wrote:
    > On Sun, 07 May 2006 00:04:01 +0100, Roger Leigh wrote:
    >
    >> ray <ray@zianet.com> writes:
    >>
    >>> On Sat, 06 May 2006 14:43:04 +0100, Michael Hopkins wrote:
    >>>>
    >>>> Fairly new to Debian/Ubuntu server and wanting to backup the
    >>>> essential directories (with rsync and cron or possibly compressed)
    >>>> to a smaller backup disk so that, if the worst happens, a system
    >>>> rebuild won't be too painful.
    >>>
    >>> IMHO - /home is the essential one. Doing another install is a trivial task.
    >>
    >> It's not usually trivial. On a system that has been in any real use
    >> for any length of time, there will be endless customisations you'll
    >> have made, lots of extra software installed, and recreating the old
    >> setup from scratch will be difficult, since the base install will need
    >> a lot of work. As a result, you'll need to save /etc and the package
    >> manager's package list in order to recreate it. Some parts of /var
    >> are also useful here in some cases (e.g. PostgreSQL databases).
    >>
    >> For user data, you'll need /home, but nowadays you'll also likely need
    >> to backup /srv as well for your system's data (databases, websites,
    >> shared data, CVS/SVN/TLA/BZR RCS data, chroots, etc.)
    >>
    >>
    >> I back up:
    >> $(dpkg --get-selections)
    >> /etc
    >> /home
    >> /srv
    >> /var/lib
    >>
    >> I blat it over the network onto a set of Zip discs, since I don't have
    >> a tape drive.
    >>
    >> To back up to another system, rsync is OK. You might want to look at
    >> Amanda backup to tape if you want a decent backup system.
    >>
    >>
    >> Regards,
    >> Roger
    >
    > A few months ago I had a hard disk go bad. The entire sequence of events
    > that followed consisted of:
    >
    > 1) get a new disk and install.
    > 2) install Elive to new disk.
    > 3) boot Elive - and copy needed partitions from hard disk -
    > basically the entire distro from two different installs - to files on the
    > new disk.
    > 4) mount partition copies on loop device to check for data retrieval - all
    > there.
    > 5) add Ubuntu and complete set-up. I had been running Mandrake and was
    > going to be doing an upgrade soon anyway.
    >
    >
    Thanks to all for ideas.

    M


    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

    _/ _/ _/_/_/ Hopkins Research Ltd
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ [url]http://www.hopkins-research.com/[/url]
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

    _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


    Michael Hopkins Guest

  13. #12

    Default Re: Essential backup directories

    Michael Hopkins wrote:
    > Would like to be able to use apt-get and
    > related tools to rebuild the whole system setup as easily as possible.
    >
    Here's how:

    Keep /home, /etc (maybe /usr/local) and all data (like databases and web
    documents) on separate partitions (and back them up). Keep a list of
    installed packages on a safe spot - create it with:

    dpkg --get-selections > /some/safe/spot/package_list.txt

    A reinstall is then really trivial and fast: do a ubuntu server install,
    at partitioning stage wipe other partitions but keep /home /etc and data
    partitions intact, finish installation and then select all packages using:

    dpkg --set-selections < /some/safe/spot/package_list.txt


    Then run dselect to install the selected packages and voila, you have a
    fresh system with all apps, settings and data intact. :)


    Lennart
    Lennart Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139