LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-28-2021, 01:11 AM   #1
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 160

Rep: Reputation: Disabled
It's save to delete pkgtool log files ?


Hello,

Today I opened the /var/log/pkgtools/removed_* directories and saw that it contains more than 20,000 files.
My question is: Can these files be deleted without prejudging the package pkgtool ?

Thanks
 
Old 11-28-2021, 01:24 AM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,523

Rep: Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489Reputation: 8489
Yes, on -current it's safe to delete anything that pkgtools puts under /var/log. It'll recreate the directories (if need be) the next time installpkg, removepkg, or upgradepkg is run.
 
6 members found this post helpful.
Old 11-28-2021, 01:40 AM   #3
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 160

Original Poster
Rep: Reputation: Disabled
Thanks. Yes on current tree.
 
Old 11-28-2021, 04:01 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,927

Rep: Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320Reputation: 7320
they are only important if there was a related problem and you want to analyze it.
 
Old 11-28-2021, 04:18 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Just don't delete anything under the /var/log/packages symlink.
That would be bad.
 
2 members found this post helpful.
Old 11-28-2021, 04:40 AM   #6
burdi01
Member
 
Registered: Dec 2010
Location: The Netherlands
Distribution: Slackware Current64, PartedMagic, Xubuntu
Posts: 465

Rep: Reputation: 114Reputation: 114
This is what I run before a system backup:
Code:
head -n1 $ROOT/var/lib/slackpkg/ChangeLog.txt > /tmp/_sqfsclean.$$ 2> /dev/null
if [ ! -s /tmp/_sqfsclean.$$ ]; then 
   head -n1 $ROOT/var/lib/slackpkg/current > /tmp/_sqfsclean.$$ 2> /dev/null
fi
rm -Rf $ROOT/var/{cache/packages,lib/slackpkg}/*
mv -f /tmp/_sqfsclean.$$ $ROOT/var/lib/slackpkg/current
rm -Rf $ROOT/var/log/removed_{packages,scripts}/*
For the $ROOT see the package tools and slackpkg.

Last edited by burdi01; 11-28-2021 at 04:46 AM.
 
Old 11-28-2021, 04:55 AM   #7
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Why do you want to remove these logs?
 
Old 11-28-2021, 05:00 AM   #8
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by burdi01 View Post
This is what I run before a system backup:
It would better to add this kind of functionality to slackpkg or pkgtool. Instead of providing home-made solutions.
 
Old 11-28-2021, 05:32 AM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Quote:
Originally Posted by igadoter View Post
Why do you want to remove these logs?
To reclaim the space I should imagine.
 
Old 11-28-2021, 05:49 AM   #10
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by GazL View Post
To reclaim the space I should imagine.
Really ?
Code:
bash-5.1$ du -sh /var/log/pkgtools/
700K	/var/log/pkgtools/
 
Old 11-28-2021, 06:18 AM   #11
uiopqwerty
Member
 
Registered: May 2020
Distribution: Slackware64 15.0
Posts: 31

Rep: Reputation: Disabled
Quote:
Originally Posted by igadoter View Post
Really ?
Code:
bash-5.1$ du -sh /var/log/pkgtools/
700K	/var/log/pkgtools/
For what it's worth ...

Code:
$ du -sh /var/log/pkgtools/
298M    /var/log/pkgtools/
But that's still nothing. Still, if someone really needs the space, it's there.
 
1 members found this post helpful.
Old 11-28-2021, 06:18 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Yes, really.

Either you've already cleared it out, or there's something wrong with your du output if it's only finding 700K
Code:
# du -sh /var/log/pkgtools/
4.6M    /var/log/pkgtools/
#

And that's just 14 days worth. I use this:
Code:
# cat /etc/cron.daily/pkgtools 
#!/bin/sh
#
#  Remove old entries from pkgtools' 'removed' directories

DAYS=14  # Days to keep.

/usr/bin/find /var/log/pkgtools/removed_packages \
     /var/log/pkgtools/removed_scripts \
     /var/log/pkgtools/removed_uninstall_scripts \
     -type f -ctime +${DAYS:-28} -delete

#

Last edited by GazL; 11-28-2021 at 06:24 AM.
 
2 members found this post helpful.
Old 11-28-2021, 06:28 AM   #13
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,901

Rep: Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025Reputation: 5025
Quote:
Originally Posted by uiopqwerty View Post
For what it's worth ...

Code:
$ du -sh /var/log/pkgtools/
298M    /var/log/pkgtools/
But that's still nothing. Still, if someone really needs the space, it's there.
It sounds more if you think of it as "1/4 of a GB".

As someone who started with 100K each side floppy disks, 300MB still seems like a lot to me.

Last edited by GazL; 11-28-2021 at 06:30 AM.
 
1 members found this post helpful.
Old 11-28-2021, 07:14 AM   #14
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by volkerdi View Post
Yes, on -current it's safe to delete anything that pkgtools puts under /var/log. It'll recreate the directories (if need be) the next time installpkg, removepkg, or upgradepkg is run.
300 MB does not fit with this. What are you guys doing? Updating ten times daily? Let us see contents of directories and timestamps of your logs. Logs from all updates are kept there not only recent ones? Why's that? Those with huge size of /var/log/platoon are you using slackpkg? Maybe these are slackpkg settings. You have chosen this kind of slackpkg behavior. So it doesn't remove old logs.

Edit: platoon? Wow.

Last edited by igadoter; 11-28-2021 at 07:30 AM.
 
Old 11-28-2021, 07:23 AM   #15
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled
Quote:
Originally Posted by igadoter View Post
Logs from all updates are kept there not only recent ones?
Yes, it is useful to debug things which happened long time ago.
Personally, I've used cron to archive most relevant logs and discard the rest. So it's been cleared weekly.
Except for the logs symlinked to /tmp/ which is just tmpfs, cleared on shutdown/reboot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file LittleMaster Linux - Server 0 09-04-2018 03:45 PM
Can I delete files in /mnt/tmp? and Files in the trash can will not delete? M$ISBS Slackware 15 10-02-2009 11:56 PM
OpenSSL version different in log and pkgtool z-man5 Slackware 21 05-24-2007 03:26 PM
rm -r /var/log - oops - pkgtool package list gone technomeister Slackware 12 02-06-2007 12:37 AM
delete old kernel with pkgtool wetnose23 Slackware 2 07-14-2006 08:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration