You are not logged in.

#1 2004-12-01 20:29:14

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 707
Website

Backup

I've crashed my computer many times now, due to my stupidity.  Each time, I have lost files.  I guess it's time for me to get a backup system going... sigh...

I've been thinking... What directories are vital to backup?  Here are the main two:
/etc
/home

Is there a way to generate a text file of all installed packages on the system?  That way, you could have a backup system like this:
Backup /etc
Backup /home
Backup Package List
Then your restore could be like this:
Restore /etc
Restore /home
Read all packages from list and reinstall them

Would you be good to go from there?  Would backing up and restoring be THAT easy?

What are your thoughts on this method?  Is it possible through pacman?


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#2 2004-12-01 20:41:59

punkrockguy318
Member
From: New Jersey
Registered: 2004-02-15
Posts: 707
Website

Re: Backup

Also: /root would need to be backed up...

But what about var?


If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing.   1 Corinthians 13:2

Offline

#3 2004-12-01 22:55:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Backup

try something like this:

ls /var/lib/pacman/local | sed -e "s/-[0-9.]+-[0-9]+//g" > installed-pkgs.list

it might not be perfect, my regexp may be off... but basically I want to take the entire ls output, and strip off the pkgver and pkgrel at the end...

the format is as follows:
my-package-name-0.1.2.3.4.5-3
transforms to:
my-package-name

edit:
then to reinstall:

for PKG in `cat installed-pkgs.list`; do pacman -S $PKG; done

this, once again, may not be the best of command snippets, but its a starting place

Offline

#4 2004-12-01 23:00:30

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Backup

punkrockguy318 wrote:

Also: /root would need to be backed up...

But what about var?

bah don't back up /root - do you really make custom configs for root? I always su, then exit after doing my stuff, so the biggest thing changed in /root is bash_history stuff.

/var is made for things which change alot... nothing is every installed to var and you can actually safely rm -rf /var/* on a live system.... /var is used for things like printer spools, log files, tmp files, cache, and other things....
you may want to back up /var/logs/* just to see what happened before the system borked...
also, you could always backup /var/cache/pacman if you're trying to keep a stable system - this way you get all the pkg files as they were last installed on the system... assuming, of course, that none failed and you didnt recently do a cache clean

Offline

#5 2004-12-01 23:01:00

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Backup

You could use this not YET released script to determine the ALL files that need to be moved onto a new computer... + some extra lines (see above) to get the installed packages list.

Offline

#6 2004-12-01 23:04:13

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Backup

bah, i'm getting there when i get a chance - recently distracted with World of Warcraft

Offline

#7 2004-12-01 23:36:33

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Backup

phrakture wrote:

bah, i'm getting there when i get a chance - recently distracted with World of Warcraft

Err.. That was only a shortcut, to skip over some of the above stepts (which should suffice under normal conditions) - I have to admit that this script stays active in my memory as I personally see it as the other half (complement) of pacman that would make it close to perfect (pacman is perfect now too, but on another scale).

Offline

#8 2004-12-01 23:43:56

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Backup

IceRAM wrote:

pacman is perfect now too.

No its not. I said so once too, but Sarah31 corrected me.

lol

Dusty

Offline

#9 2004-12-02 09:01:44

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Backup

Dusty wrote:
IceRAM wrote:

pacman is perfect now too.

No its not.

You're taking words out of their context!
I didn't put period after "too", there's also ",but on another scale" there.

Offline

#10 2004-12-02 21:26:05

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Backup

phrakture wrote:

/var is made for things which change alot... nothing is every installed to var and you can actually safely rm -rf /var/* on a live system.... /var is used for things like printer spools, log files, tmp files, cache, and other things....

If you didn't mind losing your mail spool file (/var/spool/mail/<username>), mysql databases (/var/lib/mysql), pacman db (/var/lib/pacman), etc...

/var is used for system specific data files.  It will never be mounted over nfs and so anything in there will be specific to that host.  Doesn't mean that important stuff isn't stored in there.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

Board footer

Powered by FluxBB