|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
/etc/security to notice changes in installed packages
From: -f (f
obiit.org)
Date: Wed Jan 12 2005 - 15:13:59 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi there,
i am making a homegrown backup script ("tar cvzf b.tgz /")
and i thoght that it would be nice to have a list of all the
installed packages if the worst happens. i know that it is
"ls /var/db/pkg" but it is good to have it in one file and
it is really easy to plug this in into the backup framework...
people who keep their daily/security mails archived may find
it nice to see how the packages were added and when.
amaaq> diff -u /etc/security ./security
--- /etc/security Fri Sep 17 19:59:13 2004
+++ ./security Wed Jan 12 22:08:30 2005

-713,3 +713,26 
fi
rm -f $file
done
+
+# Make list of installed packages
+file=/var/backups/pkg_info
+CUR=$file.current
+BACK=$file.backup
+
+if pkg_info > $file 2>&1 ; then
+ if [ -s $CUR ] ; then
+ diff -u $CUR $file > $OUTPUT
+ if [ -s $OUTPUT ] ; then
+ echo "\n======\n${file} diffs (-OLD +NEW)\n======"
+ cat $OUTPUT
+ cp -p $CUR $BACK
+ cp -p $file $CUR
+ chown root:wheel $CUR $BACK
+ fi
+ else
+ cp -p $file $CUR
+ chown root:wheel $CUR
+ fi
+fi
+rm -f $file
--
name a psychological rock group? pink freud!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]