Re: 1600007 kernel, 1600012 userland: .pkgsave files
- In reply to: Graham Perrin : "1600007 kernel, 1600012 userland: .pkgsave files"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 08 Mar 2026 23:05:06 UTC
On Sun, 8 Mar 2026, Graham Perrin wrote:
>> root@maximal:~ # uname -KU
>> 1600007 1600012
>
> Resolved:
> find /boot -name '*.pkgsave' -delete
Or run this script as "pkgsave_cleanup /boot".
#!/bin/sh -
## pkgsave_cleanup
# Archive .pkgsave files created in multiple locations by messy upgrade apps,
# preserving the original path and deleting unchanged files.
## to do:
# Check-in as appropriate.
# See also: etcupdate, zfs snapshot, beadm, ...
PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
set -a
DBPATH=/var/db/pkgsave/`date +%G%m%d%H%M`
SEARCHROOT=/
usage () {
echo " USAGE: `basename $0` [search_root]"
exit
}
if [ $# -gt 0 ]; then
if [ $# -gt 1 ] || [ $1 = -h ]; then
usage
elif [ ! -d $1 ]; then
echo " ERROR: directory $1 not found"
usage
else
SEARCHROOT=$1
fi
fi
for f in `find ${SEARCHROOT}/ -type f -name \*.pkgsave | grep -v $DBPATH` ; do
fori="`echo $f | sed 's/.pkgsave//'`"
diff $f $fori >/dev/null 2>&1
if [ $? = 0 ]; then
rm -f $f
else
oripath="`dirname $f`"
if [ ! -d $DBPATH/$oripath ]; then
mkdir -p $DBPATH/$oripath || exit 1
fi
mv -f $f $DBPATH/$oripath || exit 1
fi
done
if [ -d $DBPATH ]; then
echo
echo " Cleaned up: "
ls -lt `find $DBPATH/ -type f` | sed 's/^/ /'
echo
fi