You are not logged in.

#1 2009-05-05 07:09:02

K0tuk
Member
Registered: 2009-04-06
Posts: 125

How-to backup your machine?

Hi!

I came to the point when my i686 Arch is setup with OpenBox and all software i need runs without issues. Now, if i screw something up, i may lose everything, and it would be a pain in the rear to reinstall/reconfigure everything. So i thought about the thing i never did in the past: backing up my system. I`ve googled a bit and saw some utilities for it, but i would like to hear my fellow archers` opinions. So, what i want from the backup software is (don`t laugh if i ask something funny, i`ve never backup-ed anything before big_smile ):

-easy backup of all the data on my /, home and /var partitions ( which is 30Ggb + 50Ggb + 7Ggb ) to another partition. Is that possible?
-easy restore of this data.

Would love to hear your opinions and suggestions.

Offline

#2 2009-05-05 07:32:07

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: How-to backup your machine?

GUI: backintime
CLI: rsync or tar

Offline

#3 2009-05-05 08:57:41

cb474
Member
Registered: 2009-04-04
Posts: 469

Re: How-to backup your machine?

I like to make images of my entire / partition to back it up for this purpose. I'm using partimage, running it off of the clonezilla boot usb environment: http://clonezilla.org/ You can also make a boot cd of clonezilla, but running it off of a usb key is pretty convenient.

Clonezilla is pretty cool. It will also work on NTFS partitions and compress you data so you don't have a huge image. I haven't really figured out what the advantage to partclone is, instead of partimage, both similar programs included with clonezilla.

I have to admit, though, I have not restored a partition yet from an image I've saved. So I'm just assuming it will work. On my old system, I committed sacrilege and just booted into Windows and used Acronis (commercial backup software) to make images of my ext3 partitions. Acronis always worked great. Although Clonezilla offers more different types of compression and can make smaller backup files. I have no desire to go back to Acronis. I'm just crossing my fingers that restoring an image will work if I need it.

Offline

#4 2009-05-05 10:20:31

Solid1986Snake
Member
Registered: 2007-06-18
Posts: 258

Re: How-to backup your machine?

Not so powerful like backintime, but qt and very ease to use: luckybackup in aur

Offline

#5 2009-05-05 14:20:43

djnm
Member
From: USA
Registered: 2008-12-21
Posts: 78

Re: How-to backup your machine?


br0tat0chip in #archlinux and on freenode

Offline

#6 2009-05-05 15:25:12

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: How-to backup your machine?

i use my own backup script.  it's very readable, just change the rsyncs and $dir variable to your liking. 

i also have an untested (thankfully) and much much less readable restore script that could -- in theory -- use those backups in an automated restore.

what "backup" does:
   uses rsync to backup /home (excluding some big / unimportant directories), /etc, /usr, and /var.
   creates separate lists of installed pacman and non-pacman packages

what "restore" does (or might do...):
   restores /var
   installs from pacman list
   restores /home
   installs from non-pacman list (you did save those in ~/Packages right?)
   restores /usr and /etc
   restores a customized fstab (that parts pretty specific to my needs)

the likely scenario
   backup in a nightly cron job
   your system dies
   do a fresh install
   run restore
   profit


it's worth a look, but i'd recommend just using it as a base to write your own solution.  it's a great way to start learning bash.

Offline

#7 2009-05-05 19:08:46

utore
Member
From: USA
Registered: 2008-01-27
Posts: 67
Website

Re: How-to backup your machine?

I have rsync setup to run various cronjobs backing up different directories of my system each night. These cronjobs and their directories are staggered throughout the week/month depending the on the directory. I backup my home directory about once a week and move the old copy into another directory (which is overwritten by the second oldest backup when there's a new backup) just in case. I have yet to actually try to restore my full system from one of these backups, so I'll eventually see how inefficient this is then. Until then, ignorance is power.


Something witty.

Offline

#8 2009-05-05 19:39:18

kyouens
Member
Registered: 2009-03-20
Posts: 19
Website

Re: How-to backup your machine?

I use rdiff to do a nightly backup to an external USB drive.  It's easy to configure which directories to include and exclude based on a text file that the binary reads.  I have a bash script set up as a cron job to run it in the middle of the night.  It's pretty simple, but if you're interested, let me know and I'll post it here.

Offline

#9 2009-05-05 20:04:35

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: How-to backup your machine?

I have a dead simple script that I run to backup my system, it's not very elegant but gets the job done:

#!/bin/bash
# Arch backup

cd /home/backup
tar zcvfp arch-system-untar-to-newdir.tar.gz /etc /boot /root /var/lib/pacman/local
tar zcvfp arch-user1-untar-to-newdir.tar.gz /home/user1
tar zcvfp arch-user2-untar-to-newdir.tar.gz /home/user2
tar zcvfp backup-stuff-untar-to-new-dir.tar.gz /home/stuff

cp *.tar.gz '/media/Back/New_CD/Backups'

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2009-05-05 22:33:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: How-to backup your machine?

I forgot about this script which is what I use on my servers:
http://repo.falconn.nl/any/filesystem-b … pkg.tar.gz

It's just a bash script that does tar, and it's not very space efficient, but it covers everything in rolling backups (Rolling 7 days, Rolling 4 x weeks and all monthly backups).

Offline

#11 2009-05-06 13:56:37

K0tuk
Member
Registered: 2009-04-06
Posts: 125

Re: How-to backup your machine?

Thanks! I`ll try Clonezilla and flyback.

Offline

#12 2009-05-06 21:10:00

YoungGods
Member
From: Europa
Registered: 2007-09-02
Posts: 23

Re: How-to backup your machine?

I use partimage from a live-cd or usb to backup my entire partition. I have restored from the backup with no problems.
I'll probably check a couple of suggestions from this thread smile

Offline

#13 2009-05-07 06:47:59

robmaloy
Member
From: Germany
Registered: 2008-05-14
Posts: 263

Re: How-to backup your machine?

tar

<3


☃ Snowman ☃

Offline

#14 2009-05-07 07:03:37

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: How-to backup your machine?

#!/bin/sh

ROOTD=`mount | grep 'on / type' | awk '{print $1}'`
BOOTD=`mount | grep 'on /boot type' | awk '{print $1}'`
DATE=`date "+%Y.%m.%d - %H.%M.%S"`
EXCLUDE="/tmp/rsync-excludes.rc"
EXCLUDES=(
    'tmp/*'
    'tmp/.*'
    '.mozilla/firefox/*/Cache'
    'cookies.sqlite'
    'formhistory.sqlite'
    '.thumbnails'
    '.recently-used.xbel'
    '.ccache'
    'sessionstore.js'
)

umount /mnt/backup /dev/disk/by-label/backup
mkdir /mnt/backup &> /dev/null

echo -n "Mounting the backup disk... "
if mount -o noatime /dev/disk/by-label/backup /mnt/backup; then
    echo "[DONE]"
    echo -n "Backing up system... "

    echo > /tmp/rsync-excludes.rc
    for file in ${EXCLUDES[@]}; do
        echo "$file" >> "$EXCLUDE"
    done

    rsync -axPl --delete --delete-excluded --link-dest=/mnt/backup --exclude-from="$EXCLUDE" / "/mnt/backup/$(hostname) - $DATE"
    rm /mnt/backup/current
    ln -s "$(hostname) - $DATE" /mnt/backup/current
    sync
    rm "$EXCLUDE"

    echo "[DONE]"
    echo -n "Unmounting backup partition... "
    if umount /mnt/backup; then
        echo "[DONE]"
        rmdir /mnt/backup
    else
        echo "[FAIL]"
    fi
else
    echo "[FAIL]"
fi

Offline

#15 2009-05-07 09:21:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: How-to backup your machine?

Nice... But what are BOOTD and ROOTD for...? :s

Offline

#16 2009-05-07 15:32:54

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: How-to backup your machine?

K0tuk wrote:

Would love to hear your opinions and suggestions.

I use rybackup, as posted previously in the "self made command line utilities" thread - where you will find numerous other backup scripts and solutions.


You need to install an RTFM interface.

Offline

Board footer

Powered by FluxBB