Re: backup all the changes I made to the "virgin debian system"

2002-06-25 Thread Colin Watson
[No need to cc me; I read the list.]

On Mon, Jun 24, 2002 at 08:43:38PM -0400, Ian D. Stewart wrote:
> After further inventigation, it looks like apt-get -d can be used to download 
> necessary packages without installing them.
> 
> Colin, 
> 
> If a .deb for a given package exists in /var/cache/apt/archives, will apt-get 
> -d still download it, or will it use the local package?

I believe it'll use the local package, assuming that it has the expected
size and md5sum. I don't often use -d, mind you.

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-25 Thread Romuald DELAVERGNE

Le 2002.06.25 02:43, Ian D. Stewart a écrit :

If a .deb for a given package exists in /var/cache/apt/archives, will
apt-get
-d still download it, or will it use the local package?



It use the local package.
-d means not install and not force download.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-25 Thread Ulf Rompe
Hi,

about three months ago I wrote some related thoughts in article
<[EMAIL PROTECTED]>. Four weeks ago I got the first and
only reply to it - must be because of the quality and my good english.
:-)

But hey, I don't give up, so here is an extract of my thoughts
*again*, still untested, but it may be a point to start:


# Backing up config files:

cat /var/lib/dpkg/info/*.conffiles | xargs tar czf /backup/config.tgz

# Backing up all files *not* included in debian packages:

cat /var/lib/dpkg/info/*.list | sort >/tmp/tmplist.debian
find / -xdev -type f | sort >/tmp/tmplist.reallife
comm -13 /tmp/tmplist.debian /tmp/tmplist.reallife | \
 xargs tar czf /backup/additions.tgz

# Backing up all packaged but changed files:

cd /
cat /var/lib/dpkg/info/*.md5sums | \
LANG=en_US md5sum -c 2>&1 | cut -d\' -f2 | \
xargs tar czf /backup/changed.tgz


[x] ulf

-- 
"I heard if you play the Windows-XP-CD backwards, you get a satanic message."
"That's nothing, if you play it forward, it installs Windows XP"


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-25 Thread Ian D. Stewart
On Monday 24 June 2002 20:19, Ian D. Stewart wrote:

I know, pretty bad, replying to my own mail... ;)

>
> I think I'm starting to see the problem.  As far as I can tell, dpkg does
> not record the datetime when any particular package is installed/upgraded,
> and I can't find anywhere else where this information is maintained either.
>  The trick then becomes accurately determining this information from some
> other set of heuristics.
>
> Apt obviously know's how to grab a .deb given a package name and set of
> sources.  Perhaps this could be leveraged, so as to avoid reinventing the
> wheel.

After further inventigation, it looks like apt-get -d can be used to download 
necessary packages without installing them.

Colin, 

If a .deb for a given package exists in /var/cache/apt/archives, will apt-get 
-d still download it, or will it use the local package?


Ian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-24 Thread Ian D. Stewart
On Monday 24 June 2002 18:03, Colin Watson wrote:
> On Mon, Jun 24, 2002 at 11:25:33AM -0400, Ian D. Stewart wrote:
> > On Sunday 23 June 2002 23:40, Dan Jacobson wrote:
> > > Thanks Brian for the CVS tips.  But even if I were to go that route I
> > > must still locate all the files except for in /home that I have
> > > changed from the virgin debian system.
> >
> > I imagine it would be relatively straight forward to write a shell script
> > that uses dpkg --listfiles to get a list of files for a given package
> > than compare their modification time against the datetime when the
> > package was installed.
>
> The modtime of an unmodified file from a .deb is not necessarily the
> time when the package was installed, since tar (and hence dpkg)
> preserves the modtimes it finds in the archive it's unpacking. You would
> need to download each .deb and use 'dpkg -c' to get the detailed file
> list.

I think I'm starting to see the problem.  As far as I can tell, dpkg does not 
record the datetime when any particular package is installed/upgraded, and I 
can't find anywhere else where this information is maintained either.  The 
trick then becomes accurately determining this information from some other 
set of heuristics.

Apt obviously know's how to grab a .deb given a package name and set of 
sources.  Perhaps this could be leveraged, so as to avoid reinventing the 
wheel.


Ian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-24 Thread Colin Watson
On Mon, Jun 24, 2002 at 11:25:33AM -0400, Ian D. Stewart wrote:
> On Sunday 23 June 2002 23:40, Dan Jacobson wrote:
> > Thanks Brian for the CVS tips.  But even if I were to go that route I
> > must still locate all the files except for in /home that I have
> > changed from the virgin debian system.
> 
> I imagine it would be relatively straight forward to write a shell script 
> that uses dpkg --listfiles to get a list of files for a given package than 
> compare their modification time against the datetime when the package was 
> installed.

The modtime of an unmodified file from a .deb is not necessarily the
time when the package was installed, since tar (and hence dpkg)
preserves the modtimes it finds in the archive it's unpacking. You would
need to download each .deb and use 'dpkg -c' to get the detailed file
list.

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-24 Thread Ian D. Stewart
On Sunday 23 June 2002 23:40, Dan Jacobson wrote:
> Thanks Brian for the CVS tips.  But even if I were to go that route I
> must still locate all the files except for in /home that I have
> changed from the virgin debian system.

I imagine it would be relatively straight forward to write a shell script 
that uses dpkg --listfiles to get a list of files for a given package than 
compare their modification time against the datetime when the package was 
installed.

Come to think of it, that might not be a bad mini-project (assuming it hasn't 
been done already).


Ian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-24 Thread Brian Mays
> Thanks Brian for the CVS tips.  But even if I were to go that route
> I must still locate all the files except for in /home that I have
> changed from the virgin debian system.

Why don't you try looking for all files that have been modified since
your install?  You haven't upgraded any packages have you?  If not, then
all of the files from your initial installation should be *older* than
the installation date; the changes that you have made to your system
should be *newer* than this date.  For example, you could try the
following:

   find /etc -newer /etc/hostname

Usually, /etc/hostname isn't modified after the initial installation, so
it should be a good marker for when you installed Debian.  You might get
some false positives, and I suppose that this technique could miss a few
files.  Nevertheless, it's better than nothing.

Check your modified files into RCS after you find them, and you'll be
able to track your local changes much better.

- Brian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-23 Thread Dan Jacobson
Thanks Brian for the CVS tips.  But even if I were to go that route I
must still locate all the files except for in /home that I have
changed from the virgin debian system.

One interesting was is to check my .emacs ".backups", as I use
backup-dir.el, then use, you know,

#oh, this would miss them if there was only one copy, say from not
#using emacs and using ed instead
set -eu
o=/d/a_debian_dumb_root_backup$$
ls /{usr,root,etc,var}/.backups|
sed '/^\//d;s#\(.*\)!!!\(.*\)!\.~[0-9]\+~$#/\2/\1#;s#!#/#g;/\//!d'|uniq|
while read f;do test -f $f && echo $f; done|
cpio -o > $o &&
bzip2 $o

but I was thinking there might be a way say using checksums/dates from the
dpkg catalog of the files that were installed originally or something.  
-- 
http://jidanni.org/ Taiwan(04)25854780


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup all the changes I made to the "virgin debian system"

2002-06-22 Thread Brian Mays
Dan Jacobson <[EMAIL PROTECTED]> wrote:

> Well, it's been a month of me editing various files turning my virgin
> woody system into one that actually works :-) , and now boy do I
> regret not keeping a captain's log of at least the names of the files
> I changed.  I was thinking that there would be some automatic way to
> detect this --- and you guys are going to tell me how please.

You should have asked this before you began changing all of these
files.

> Goal: to backup just the changes I made to the "virgin debian system."
> Sure hope my backup file will be slim and trim.  I will make a bzip2ed
> cpio, just tell me the filenames.  I will have 2 CD-R's and alternate
> appending these cpio.bz2's to them every few weeks and keeping them in
> separate places in the house.

Try using RCS to track your modified config files.  This has the
advantage that you will also have a record of all of the changes that
you have made.  See rcsintro(1) for more information (in the rcs
package).

The process goes as follows:

1) Install a package (or packages)

2) Check in the file that you want to edit with

   ci -m"Original Debian version" -l config_file

3) Edit the file (e.g., "vi config_file")

4) Check in the revised version with

   ci -l config_file

Thus, you have a copy of the original file and a copy of your changes.
If you are consistent in tracking your changes with RCS, you can go back
later and recover your config files from any moment in time.  Finally,
if you would like to back up your changes to configuration files, simply
archive all of the files under /etc that end in ",v", since they will be
the RCS files containing the entire history of the config files that you
have modified.

More complicated scenarios are possible, such as using branches to track
changes to the Debian version of the config file and merging these
changes back into your modified version of the file.  I leave these as
an exercise to the reader.  Read the RCS documentation to learn how to
do this.

- Brian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



backup all the changes I made to the "virgin debian system"

2002-06-22 Thread Dan Jacobson
Well, it's been a month of me editing various files turning my virgin
woody system into one that actually works :-) , and now boy do I
regret not keeping a captain's log of at least the names of the files
I changed.  I was thinking that there would be some automatic way to
detect this --- and you guys are going to tell me how please.

Goal: to backup just the changes I made to the "virgin debian system."
Sure hope my backup file will be slim and trim.  I will make a bzip2ed
cpio, just tell me the filenames.  I will have 2 CD-R's and alternate
appending these cpio.bz2's to them every few weeks and keeping them in
separate places in the house.

Hmmm, I suppose I should first make a little list of what packages are
installed and even intending to be installed...

Now about all the files I changed.  Sure most are on /etc but not all.
Yes I could do touch -t XXX timeline; find / -xdev -type f -newer timeline 
but then I would have to weed out lots of other non-me generated
files, plus in the future adding packages to this system would blur
the timeline.

I know, I could somehow compare the files on my machine vs. some kind
of packing list of the original contents of packages.  Perhaps a quick
check of if their date field is the same or something?
-- 
http://jidanni.org/ Taiwan(04)25854780


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]