2009/12/20 Volker Grabsch
<address@hidden>
> Mark Brand <address@hidden> wrote:
> > Volker Grabsch <
address@hidden> wrote:
> >
> > > B) Move the log files into a separate folder and add a timestamp:
> > >
> > > usr/log-PKG -> log/`date +%Y%m%d%H%M%S`-PKG
> >
> > I am curious about why you decided to use the timestamp as a prefix
> > instead of a suffix on logfiles. [...]
> > I can understand that you sometimes might want to sort
> > by timestamp, but "ls -t" will do that.
>
> [...] When I need to
> sort/search by date, it's typically to do a diff between builds, and a
> timestamped directory is easier in this case. Attached are the changes to
> use a suffix instead and create the directories I like to use.
Tony, Mark, thanks for your input! I'm trying to improve my
solution. However, I'd like to keep it simple, and having
three symlinks for each logfile looks a bit clumsy to me.
As we can always sort log files by date, and keep them into
sub directories, there isn't any reason to put a timestamp
to the file names. Also, I like the idea of having a single
directory (=timestamp) for a whole build, rather than separate
timestamps for each package.
The main use case for a timestamp in the filename is when comparing a single package between builds, and you don't know which timestamped directories it will be in. I've been trying a layout similar to A below, with an "all" directory that has pkg-timestamp files, and find I don't use it much. The times I need to do this, the file is always in the last timestamp directory, and easy enough to find.
So two directory layouts for log/ come into mind:
A)
log/
TIMESTAMP1/
pkg1
pkg3
...
TIMESTAMP2/
pkg1
pkg5
...
...
pkg1 -> TIMESTAMP2/pkg1
pkg3 -> TIMESTAMP1/pkg3
pkg5 -> TIMESTAMP2/pkg5
...
B)
log/
TIMESTAMP1/
pkg1
pkg3
...
TIMESTAMP2/
pkg1
pkg5
...
latest -> TIMESTAMP2/
Personally, I'd prefer A), because there every latest logfile
for each package is easily accessible, without any sub directories.
> I'm pretty sure this covers all my needs:
> -preserve log files
> -find log for failing pkg quickly
> -compare logs for individual pkg easily
> -compare build directories easily
What do you think about it? Does A) fullfil all your requirements?
Or is B) better for some reasons? Or do you have a completely different
proposal?
A is preferable, I've been using much the same layout here, and find it covers everything.
Tony