You are not logged in.

#1 2007-12-16 00:01:30

Flasher
Member
From: Bavaria / Germany
Registered: 2005-04-24
Posts: 126

Which files/directories should be backuped?

Hello!

I tested around with rsync for a backup solution. I sync my important data to my home-server, which have a RAID 1 array.
rsync is simple and fast big_smile

But I don't know, what I have to backup on my client system in case of a harddisc crash.
My client system is a computer with a raid 0 array --> fast but dangerous.

Okay, at the moment I sync the following directories:

/home/$USER
/etc

But what is also necessary to backup?

Something in /var?

After a harddisc crash I wan't to restore my system with the same packages installed! Maybe some files from pacman?

Thanks for your hints!

Best regards,

Flasher

Offline

#2 2007-12-16 00:20:25

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Which files/directories should be backuped?

/opt for all the programs that currently get stored there


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#3 2007-12-16 00:20:37

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Re: Which files/directories should be backuped?

I assume you got any script running in a crond or something so do something like "pacman -Q | awk '{ print $2 }' > pkglist" to store the names of all pkgs installed, then if you would like to install them all again you will just need to type "pacman -S `cat pkglist`"


http://timtux.net/ - my personal blog about almost everything

Offline

#4 2007-12-16 00:26:08

fed359
Member
Registered: 2007-11-21
Posts: 46

Re: Which files/directories should be backuped?

"pacman -Q | awk '{ print $2 }' > pkglist"
Wouldn't you want to use $1?

Combining this technique with backing up the pacman cache in /var/cache/packman/pkg would have a system up running fairly quickly. Backing up the cache allows pacman to use locally cached copies of the packages rather than having to redownload from the repos.

edit: the pacman cache will grow fairly quickly since it will store old versions as well as current versions, so this may require a bit of cleanup from time to time.

Last edited by fed359 (2007-12-16 00:28:41)

Offline

#5 2007-12-16 00:42:22

kakTuZ
Member
From: Hannover, Germany
Registered: 2007-10-20
Posts: 86

Re: Which files/directories should be backuped?

the default setting of simple-backup also includes /usr/local which is quite usefull if you have something in there

Edit: just looked at the filesystem. /boot and /root are worth to include, too

Last edited by kakTuZ (2007-12-16 00:46:10)

Offline

#6 2007-12-16 01:03:56

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Which files/directories should be backuped?

/etc and /home should be enough

/boot isn't needed, nor /root -- you shouldn't be running as your root user.

/usr/local and /opt are pointless unless you actually specifically put stuff there you can't replace

the pacman package list is a good idea though smile

Offline

#7 2007-12-16 13:32:34

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Re: Which files/directories should be backuped?

fed359 wrote:

"pacman -Q | awk '{ print $2 }' > pkglist"
Wouldn't you want to use $1?

Combining this technique with backing up the pacman cache in /var/cache/packman/pkg would have a system up running fairly quickly. Backing up the cache allows pacman to use locally cached copies of the packages rather than having to redownload from the repos.

edit: the pacman cache will grow fairly quickly since it will store old versions as well as current versions, so this may require a bit of cleanup from time to time.

Oh yhea, $1 . Didn't test the command, just wrote it smile

Last edited by timtux (2007-12-16 13:41:51)


http://timtux.net/ - my personal blog about almost everything

Offline

#8 2007-12-24 22:00:36

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Which files/directories should be backuped?

I just found this thread as I am looking for a proper backup method for my Arch install. Can someone please elaborate on the pacman cache and the package list? So I make a list of the packages installed, then the cat command reinstalls all of them? It doesn't include stuff from AUR, right?

And I can just copy over my /etc to my root when I reinstall?

Offline

#9 2007-12-25 04:04:30

dante4d
Member
From: Czech Republic
Registered: 2007-04-14
Posts: 176

Re: Which files/directories should be backuped?

colbert wrote:

I just found this thread as I am looking for a proper backup method for my Arch install. Can someone please elaborate on the pacman cache and the package list? So I make a list of the packages installed, then the cat command reinstalls all of them? It doesn't include stuff from AUR, right?

And I can just copy over my /etc to my root when I reinstall?

If you have same hw/sw config... you can just pack/unpack '/etc'.

For the AUR part, then just use 'yaourt -Q | awk '{ print $1}' > pkglist' => 'yaourt -S `cat pkglist`'. That should do the trick. Yaourt also uses pakage/PKGBUILD/sources cache, no? That means you could backup even that.

Offline

#10 2007-12-25 11:41:42

Flasher
Member
From: Bavaria / Germany
Registered: 2005-04-24
Posts: 126

Re: Which files/directories should be backuped?

Hello!

I post you my finished script, so you can make modifications for your needs!

#! /bin/bash

hostname=`hostname`

# User specific backup
username=user1
if [ -d /home/$username ]
then
    rsync -aux -v --delete --password-file /home/$username/.rsyncpw /home/$username/ $username\@sn-server-01.sim-net.local::$username\_$hostname\_arch-linux
fi

username=user2
if [ -d /home/$username ]
then
    rsync -aux -v --delete --password-file /home/$username/.rsyncpw /home/$username/ $username\@sn-server-01.sim-net.local::$username\_$hostname\_arch-linux
fi

username=user3
if [ -d /home/$username ]
then
    rsync -aux -v --delete --password-file /home/$username/.rsyncpw /home/$username/ $username\@sn-server-01.sim-net.local::$username\_$hostname\_arch-linux
fi

username=user4
if [ -d /home/$username ]
then
    rsync -aux -v --delete --password-file /home/$username/.rsyncpw /home/$username/ $username\@sn-server-01.sim-net.local::$username\_$hostname\_arch-linux
fi


# System backup
rsync -aux -v --delete --password-file /root/.rsyncpw /etc $hostname\@sn-server-01.sim-net.local::system\_$hostname\_arch-linux
rsync -aux -v --delete --password-file /root/.rsyncpw /boot $hostname\@sn-server-01.sim-net.local::system\_$hostname\_arch-linux
rsync -aux -v --delete --password-file /root/.rsyncpw /var/log $hostname\@sn-server-01.sim-net.local::system\_$hostname\_arch-linux
rsync -aux -v --delete --password-file /root/.rsyncpw /root $hostname\@sn-server-01.sim-net.local::system\_$hostname\_arch-linux

pacman -Q | awk '{ print $1 }' > /pkglist
rsync -aux -v --delete --password-file /root/.rsyncpw /pkglist $hostname\@sn-server-01.sim-net.local::system\_$hostname\_arch-linux
rm /pkglist

Greetings

Flasher

Offline

Board footer

Powered by FluxBB