Essential backup directories - Debian

This is a discussion on Essential backup directories - Debian ; 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 ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: Essential backup directories

  1. 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
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ http://www.hopkins-research.com/
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

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



  2. Re: Essential backup directories

    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
    >
    > ..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.


    dpkg --get-selections >selections.list

    Will make a text file listing all the packages you have installed. Back
    up that text file and you can use it to rebuild a system (or clone it
    on another box) with the commands:

    dpkg --get-selections dselect install

    That will install the latest versions of everything from whatever
    sources you have chosen in /etc/apt/sources.list.

    There may be better ways but that one's fairly simple to understand,
    which suits me :-)

    --
    Anahata
    anahata@treewind.co.uk -+- http://www.treewind.co.uk
    Home: 01638 720444 Mob: 07976 263827

  3. 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 |

  4. Re: Essential backup directories

    ["Followup-To:" header set to alt.os.linux.debian.]
    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
    >
    > ..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.
    --
    mcsuper5@usol.com http://mcsuper5.freeshell.org/

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

  5. 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;

    http://www.taobackup.com/

    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).

  6. 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. http://www.no2id.net/

    Daddy, what does "Formatting drive C:" mean?

  7. 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.


  8. Re: Essential backup directories

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

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

  9. 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

  10. Re: Essential backup directories

    ray 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
    http://www.chadfield.com/

  11. Re: Essential backup directories

    ["Followup-To:" header set to uk.comp.os.linux.]
    Roger Leigh <${rleigh}@invalid.whinlatter.ukfsn.org.invalid> wrote:
    > --=-=-=
    > Content-Transfer-Encoding: quoted-printable
    >
    > ray writes:
    >
    >> On Sat, 06 May 2006 14:43:04 +0100, Michael Hopkins wrote:
    >>>=20
    >>> 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 tas=

    > k.
    >
    > 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,


    If this is a production server, that really should not be the case.



    --
    Bruce

    Hierophant: someone who remembers, when you are on the way down,
    everything you did to them on the way up.

  12. Re: Essential backup directories

    On Sun, 07 May 2006 00:04:01 +0100, Roger Leigh wrote:

    > ray 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.



  13. Re: Essential backup directories

    On 7/5/06 16:01, in article pan.2006.05.07.15.01.33.728604@zianet.com, "ray"
    wrote:

    > On Sun, 07 May 2006 00:04:01 +0100, Roger Leigh wrote:
    >
    >> ray 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
    _/ _/ _/ _/
    _/_/_/_/ _/_/_/ http://www.hopkins-research.com/
    _/ _/ _/ _/
    _/ _/ _/ _/ 'touch the future'

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



  14. 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

  15. Re: Essential backup directories

    in message <445cdb1a$0$560$ed2619ec@ptn-nntp-reader03.plus.net>, anahata
    ('anahata@reply-to.address') wrote:

    > 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
    >>
    >> ..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.

    >
    > dpkg --get-selections >selections.list
    >
    > Will make a text file listing all the packages you have installed. Back
    > up that text file and you can use it to rebuild a system (or clone it
    > on another box) with the commands:
    >
    > dpkg --get-selections > dselect install


    Thanks for that, that's a trick I didn't know! I might put the first half
    of it into a cron script, so as to have a record of the machine's
    packages on my backup tapes.


    --
    simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/


    ... a mild, inoffensive sadist...


+ Reply to Thread