This is a discussion on deleted /var/log/packages within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Ioannis A. bouhras <ioabuh@unixfor.gr> wrote: > Grant Coady wrote: > > > > > On Wed, 08 Jun 2005 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Ioannis A. bouhras <ioabuh@unixfor.gr> wrote: > Grant Coady wrote: > > > > > On Wed, 08 Jun 2005 11:05:56 +0200, Lars Behrens <Spam.Buster@web.de> > > wrote: > >> > Should contain most if not all the packages. > >> > >> Thanks, but I deleted the whole log directory. > > > > So back it up next time > > admin of box a little more interesting. Stuff happens. > > --Grant. > > So, next time ..... .bashrc > > alias rm='rm -i' > alias cp='cp -i' > alias mv='mv -i' > .... and from then on you automatically hit 'y' every time you run one of these commands, in my experience these aliases are just a nuisance, I always remove them from systems where it has been "done for me". -- Chris Green |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In alt.os.linux.slackware, Loki Harfagr dared to utter, > A quick idea, if you have a slackware deposit or if you mount > the install cd, cd to the slackware/ dir and check like yhis : > # upgradepkg --dry-run ap/*.tgz |grep '(already installed).$' |cut -d' ' -f1 > > would list the ap/ packages you installed. Did you actually try this? It won't work. upgradepkg relies entirely on the existance of files inside /var/log/packages and does no other checking to see if the package has been previously installed. As such, deleting your directory is just going to tell you that everything hasn't been installed. The magic is in these lines of /sbin/upgradepkg. ========== # Test to see if both the old and new packages are where we expect them # to be -- skip to the next package (or package pair) if anything's wrong: if [ ! -r $ROOT/var/log/packages/$OLD ]; then if [ ! "$INSTALL_NEW" = "yes" ]; then if [ "$DRY_RUN" = "true" ]; then echo "$OLD would not be upgraded (no installed package named $SHORT)." else ========== As you can see, earlier in the script some variables were defined, namely ROOT and OLD, and upgradepkg checks $ROOT/var/log/packages/$OLD to see if a previous version was installed. To the OP, the only way I now to discover what packages were installed with any degree of certainty would be very manual, involving a script that would check MANIFEST for the existance of that file, discover what package it belongs to, and then put that list somewhere in /tmp. You could then pass it as an argument to installpkg or something. Optionally, you could just installpkg everything, them removepkg what you don't want. It's really heavy-handed, but gaurantees not to rip, run, or snag. - -- It is better to hear the rebuke of the wise, Than for a man to hear the song of fools. Ecclesiastes 7:5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFCpu2qzLTO1iU1uO4RAntrAJ9hAbsuwov/ik26Jeb7sszMlLWiUgCePeut sJUA+QuiEeWEMDVMw2ufF/c= =8VJZ -----END PGP SIGNATURE----- |
| |||
| No_One <no_one@no_where.com> wrote: > Should contain most if not all the packages. Most, indeed, not all packages have a corresponding script. -- ************************************************** ****************** ** Eef Hartman, Delft University of Technology, dept. EWI/TW ** ** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 ** ** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands ** ************************************************** ****************** |
| |||
| Lars Behrens <Spam.Buster@web.de> wrote: > Me too. But honestly I simply didn't think of the packages branch, neither > when setting up the backup nor when deleting the log directory. You should NOT delete the "log" directory anyway, too many important files (especially to guard against hackers) are there, like wtmp (historical database of logins), lastlog (when was every user last logged in) and faillog (last failed logins). Furthermore the "setup" directory is a subdir of log so you also got rid of all the setup scripts. Cleaning UP logfiles is a much better habit, look for instance at "logrotate". -- ************************************************** ****************** ** Eef Hartman, Delft University of Technology, dept. EWI/TW ** ** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 ** ** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands ** ************************************************** ****************** |
| |||
| Le Wed, 08 Jun 2005 13:08:51 +0000, +Alan Hicks+ a écrit*: > In alt.os.linux.slackware, Loki Harfagr dared to utter, >> A quick idea, if you have a slackware deposit or if you mount >> the install cd, cd to the slackware/ dir and check like yhis : >> # upgradepkg --dry-run ap/*.tgz |grep '(already installed).$' |cut -d' ' -f1 >> >> would list the ap/ packages you installed. > > Did you actually try this? No of course not, that's why I warned "A quick idea" ! I was on a hurry at work, then hadn't time to cripple an installation to check if it worked ;-) (yes, I know, a movedir'd be enough or a gentle look at the upgradepkg script, like you did :-) > It won't work. upgradepkg relies entirely > on the existance of files inside /var/log/packages and does no other > checking to see if the package has been previously installed. You're right, sorry OP, it was just a "bad quick idea" based on the way I did long ago a reconstruction of tagfiles in this way, but indeed my /var/log/ was alive ... |
| ||||
| On 2005-06-08, usenet@isbd.co.uk <usenet@isbd.co.uk> wrote: > ... and from then on you automatically hit 'y' every time you run one > of these commands, in my experience these aliases are just a nuisance, Only if you allow it to be. If you need to do a mass rm and don't want to hit 'y' every time, a simple -f option will override the -i optioned alias. nb |