Script in GUI (Was: openSUSE as a router, how to? Solved!) - Suse

This is a discussion on Script in GUI (Was: openSUSE as a router, how to? Solved!) - Suse ; Vahis wrote: > P.S. It should have a button to do this though: > > #!/bin/sh > sqlite3 /var/cache/zypp/zypp.db vacuum > rpm --rebuilddb # takes long > for fn in /var/cache/zypp/zypp.db \ > /var/lib/rpm/Packages \ > /var/lib/rpm/Filemd5s \ > /var/lib/rpm/Dirnames ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Script in GUI (Was: openSUSE as a router, how to? Solved!)

  1. Script in GUI (Was: openSUSE as a router, how to? Solved!)

    Vahis wrote:
    > P.S. It should have a button to do this though:
    >
    > #!/bin/sh
    > sqlite3 /var/cache/zypp/zypp.db vacuum
    > rpm --rebuilddb # takes long
    > for fn in /var/cache/zypp/zypp.db \
    > /var/lib/rpm/Packages \
    > /var/lib/rpm/Filemd5s \
    > /var/lib/rpm/Dirnames \
    > /var/lib/rpm/Basenames
    > do
    > cp $fn $fn.new || exit 1
    > rm $fn
    > mv $fn.new $fn
    > done


    You can have that as a button. First see to it that the script can run
    as the urser that clicks it. Probably some use of sudo and edit sudoers.

    Next you can use kdialog or zenity to turn it into a 'GUI'
    I just don't see what the script should be doing.

    The `exit 1` I would probably re-write to an errormessage that pops up
    with kdialog/zenity so you know something went wrong.

    houghi
    --
    But I will accept the rules that you feel necessary to your freedom. I am
    free, no matter what rules surround me. If I find them tolerable, I
    tolerate them; if I find them too obnoxious, I break them. I am free
    because I know that I alone am morally responsible for everything I do.

  2. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    On 2008-06-26, houghi wrote:
    > Vahis wrote:
    >> P.S. It should have a button to do this though:
    >>
    >> #!/bin/sh
    >> sqlite3 /var/cache/zypp/zypp.db vacuum
    >> rpm --rebuilddb # takes long
    >> for fn in /var/cache/zypp/zypp.db \
    >> /var/lib/rpm/Packages \
    >> /var/lib/rpm/Filemd5s \
    >> /var/lib/rpm/Dirnames \
    >> /var/lib/rpm/Basenames
    >> do
    >> cp $fn $fn.new || exit 1
    >> rm $fn
    >> mv $fn.new $fn
    >> done

    >
    > You can have that as a button. First see to it that the script can run
    > as the urser that clicks it. Probably some use of sudo and edit sudoers.


    I know it can be a button.
    >
    > Next you can use kdialog or zenity to turn it into a 'GUI'
    > I just don't see what the script should be doing.
    >


    It could be in YaST > Software > Vacuum Software Database.

    > The `exit 1` I would probably re-write to an errormessage that pops up
    > with kdialog/zenity so you know something went wrong.


    Software management slows down in a long seasoned system in 10.3.
    This script "greases the wheels"

    rpm --rebuilddb is obvious.

    It then copies the files with a new name and removes the old ones.
    Then it renames the new files to old ones.

    This "defrags" them and keeps software management running quickly as
    new.

    I haven't scrutinized what is done in 11.0 there everything is faster
    anyway.


    Vahis
    --
    Training new things here:
    http://waxborg.servepics.com
    "The only thing more expensive than training is the lack of it"
    Henry Ford

  3. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    Vahis wrote:
    >> The `exit 1` I would probably re-write to an errormessage that pops up
    >> with kdialog/zenity so you know something went wrong.

    >
    > Software management slows down in a long seasoned system in 10.3.
    > This script "greases the wheels"
    >
    > rpm --rebuilddb is obvious.


    So you want to do it often? Why not put it in a crontab. Obviously first
    test if there is nothing busy with using the database, like another rpm
    or YaST.

    > It then copies the files with a new name and removes the old ones.
    > Then it renames the new files to old ones.
    >
    > This "defrags" them and keeps software management running quickly as
    > new.


    This last part I think is odd. I see no reason for this.

    houghi
    --
    Always listen to experts. They'll tell you what can't be done,
    and why. Then do it.
    -- Heinlein : Time Enough For Love

  4. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    On 2008-06-27, houghi wrote:
    > Vahis wrote:
    >>> The `exit 1` I would probably re-write to an errormessage that pops up
    >>> with kdialog/zenity so you know something went wrong.

    >>
    >> Software management slows down in a long seasoned system in 10.3.
    >> This script "greases the wheels"
    >>
    >> rpm --rebuilddb is obvious.

    >
    > So you want to do it often? Why not put it in a crontab. Obviously first
    > test if there is nothing busy with using the database, like another rpm
    > or YaST.


    I run it occasionally, no need for a cron job.
    >
    >> It then copies the files with a new name and removes the old ones.
    >> Then it renames the new files to old ones.
    >>
    >> This "defrags" them and keeps software management running quickly as
    >> new.

    >
    > This last part I think is odd. I see no reason for this.


    After a few months of installing a lot of software and updating them
    makes the databases slow down.

    After running that script it's like a brand new installation.
    Which it the is, as for package management.

    There seems to be a point, at least here.

    Vahis
    --
    Training new things here:
    http://waxborg.servepics.com
    "The only thing more expensive than training is the lack of it"
    Henry Ford

  5. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    Vahis wrote:
    >> So you want to do it often? Why not put it in a crontab. Obviously first
    >> test if there is nothing busy with using the database, like another rpm
    >> or YaST.

    >
    > I run it occasionally, no need for a cron job.


    I have cronjobs that run once a week or once a month.

    >>> This "defrags" them and keeps software management running quickly as
    >>> new.

    >>
    >> This last part I think is odd. I see no reason for this.

    >
    > After a few months of installing a lot of software and updating them
    > makes the databases slow down.
    >
    > After running that script it's like a brand new installation.
    > Which it the is, as for package management.
    >
    > There seems to be a point, at least here.


    I understand the rpm bit. I do not get the 'defrag' bit by renaming
    files. Perhaps somebody else can explain what happens. I asume that is
    still on ReiserFS or is that already on EXT3 (or fat16?)

    houghi
    --
    Always listen to experts. They'll tell you what can't be done,
    and why. Then do it.
    -- Heinlein : Time Enough For Love

  6. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    On 2008-06-27, houghi wrote:
    > Vahis wrote:
    >>> So you want to do it often? Why not put it in a crontab. Obviously first
    >>> test if there is nothing busy with using the database, like another rpm
    >>> or YaST.

    >>
    >> I run it occasionally, no need for a cron job.

    >
    > I have cronjobs that run once a week or once a month.
    >
    >>>> This "defrags" them and keeps software management running quickly as
    >>>> new.
    >>>
    >>> This last part I think is odd. I see no reason for this.

    >>
    >> After a few months of installing a lot of software and updating them
    >> makes the databases slow down.
    >>
    >> After running that script it's like a brand new installation.
    >> Which it the is, as for package management.
    >>
    >> There seems to be a point, at least here.

    >
    > I understand the rpm bit. I do not get the 'defrag' bit by renaming
    > files.


    It's not the renaming that does it.
    It's the making new copies of the files.

    Renaming is an intermediate step required for copying the files to a new
    location with the same names.

    Then reading the new copies of the files is faster than the old ones.

    I guess that how significant this speed increase is, depends on a lot of
    factors. But as I'm always on old slow HW everything counts.

    > Perhaps somebody else can explain what happens. I asume that is
    > still on ReiserFS or is that already on EXT3 (or fat16?)


    The partition in question is ext3.
    As an explanation I'm offering that it gathers the pieces of the files
    in a new spot on the disk in one place.

    Vahis
    --
    Training new things here:
    http://waxborg.servepics.com
    "The only thing more expensive than training is the lack of it"
    Henry Ford

  7. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    Vahis wrote:
    >> I understand the rpm bit. I do not get the 'defrag' bit by renaming
    >> files.

    >
    > It's not the renaming that does it.
    > It's the making new copies of the files.


    OK:
    I understand the rpm bit. I do not get the 'defrag' bit by making new
    copies of the files.

    > Renaming is an intermediate step required for copying the files to a new
    > location with the same names.
    >
    > Then reading the new copies of the files is faster than the old ones.


    And this I do not get. Why would that happen?

    > I guess that how significant this speed increase is, depends on a lot of
    > factors. But as I'm always on old slow HW everything counts.


    It shouldn't. I see at least no reason for it.

    >> Perhaps somebody else can explain what happens. I asume that is
    >> still on ReiserFS or is that already on EXT3 (or fat16?)

    >
    > The partition in question is ext3.
    > As an explanation I'm offering that it gathers the pieces of the files
    > in a new spot on the disk in one place.


    This is not FAT so defragmenting should not be a factor. It *could* help
    the first time when moving to the centre of the HD, but that will work
    only once.

    I seriously doubt that moving from the outside to the inside will give
    you any noticable speed advantage. My guess is that if you only do the
    rpm bit, all should be well.

    houghi
    --
    Always listen to experts. They'll tell you what can't be done,
    and why. Then do it.
    -- Heinlein : Time Enough For Love

  8. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    On 2008-06-27, houghi wrote:
    > Vahis wrote:
    >>> I understand the rpm bit. I do not get the 'defrag' bit by renaming
    >>> files.

    >>
    >> It's not the renaming that does it.
    >> It's the making new copies of the files.

    >
    > OK:
    > I understand the rpm bit. I do not get the 'defrag' bit by making new
    > copies of the files.
    >
    >> Renaming is an intermediate step required for copying the files to a new
    >> location with the same names.
    >>
    >> Then reading the new copies of the files is faster than the old ones.

    >
    > And this I do not get. Why would that happen?
    >
    >> I guess that how significant this speed increase is, depends on a lot of
    >> factors. But as I'm always on old slow HW everything counts.

    >
    > It shouldn't. I see at least no reason for it.
    >
    >>> Perhaps somebody else can explain what happens. I asume that is
    >>> still on ReiserFS or is that already on EXT3 (or fat16?)

    >>
    >> The partition in question is ext3.
    >> As an explanation I'm offering that it gathers the pieces of the files
    >> in a new spot on the disk in one place.

    >
    > This is not FAT so defragmenting should not be a factor. It *could* help
    > the first time when moving to the centre of the HD, but that will work
    > only once.
    >
    > I seriously doubt that moving from the outside to the inside will give
    > you any noticable speed advantage. My guess is that if you only do the
    > rpm bit, all should be well.


    It's some time ago that I discovered this while looking for reason for
    slowing down the package management.

    It took me some time again to find where I got this from:
    http://en.opensuse.org/SDB:Speed_up_..._Manager_Stack

    Vahis
    --
    Training new things here:
    http://waxborg.servepics.com
    "The only thing more expensive than training is the lack of it"
    Henry Ford

  9. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    Vahis wrote:
    >> I seriously doubt that moving from the outside to the inside will give
    >> you any noticable speed advantage. My guess is that if you only do the
    >> rpm bit, all should be well.

    >
    > It's some time ago that I discovered this while looking for reason for
    > slowing down the package management.
    >
    > It took me some time again to find where I got this from:
    > http://en.opensuse.org/SDB:Speed_up_..._Manager_Stack


    Extremely strange and I would still like to know why.

    houghi
    --
    Always listen to experts. They'll tell you what can't be done,
    and why. Then do it.
    -- Heinlein : Time Enough For Love

  10. Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)

    On Fri, 27 Jun 2008, houghi wrote:-

    >Vahis wrote:
    >>> I seriously doubt that moving from the outside to the inside will give
    >>> you any noticable speed advantage. My guess is that if you only do the
    >>> rpm bit, all should be well.

    >>
    >> It's some time ago that I discovered this while looking for reason for
    >> slowing down the package management.
    >>
    >> It took me some time again to find where I got this from:
    >> http://en.opensuse.org/SDB:Speed_up_..._Manager_Stack

    >
    >Extremely strange and I would still like to know why.


    I can understand the compression of the zypp.db, since doing that on one
    of my 10.3 systems shrank the database down from 144MB to 77MB. I can
    maybe understand compressing/rebuilding the RPM databases, as that might
    also shrink them down a bit.

    I'm also curious about why there would need to be any de-fragmenting of
    the other files, since the only time I see any noticeable speed drops is
    when ext2/3 partitions are over 95% full. I don't know what effect it
    would have with XFS or reiserfs since I've not yet filled one of those
    file systems to that point.


    Regards,
    David Bolt

    --
    www.davjam.org/lifetype/ www.distributed.net: OGR@100Mnodes, RC5-72@15Mkeys
    SUSE 10.1 32bit | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0
    SUSE 10.1 64bit | openSUSE 10.2 64bit | openSUSE 10.3 64bit
    RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC |RISC OS 3.11

+ Reply to Thread