ShadowArch/Admin/arch-update

30 lines
894 B
Plaintext
Raw Normal View History

2016-11-09 22:25:00 -06:00
#!/bin/bash
export LOGFILE="/var/log/sysupdate.log"
date > $LOGFILE
# Update
echo == Updating Arch Packages == >> $LOGFILE
2016-11-16 16:23:52 -06:00
# pacman -Syu --noconfirm 2>&1 >> $LOGFILE # I've been having troubles with this causing crashes while online.
checkupdates >> $LOGFILE
2016-11-09 22:25:00 -06:00
echo >> $LOGFILE
# Get AUR list of update candidates
echo == AUR Candidate List == >> $LOGFILE
cower -u >> $LOGFILE
echo >> $LOGFILE
# Generate list of installed packages
echo == Generated installed-packages list == >> $LOGFILE
pacman --color never -Qem > /var/log/installed-packages.txt
pacman --color never -Qen >> /var/log/installed-packages.txt
# Generate list of orphaned packages
echo == Generated orphaned-packages list == >> $LOGFILE
pacman -Qdtq > /var/log/orphaned-packages.txt
echo >> $LOGFILE
date >> $LOGFILE
printf '\n\n' >> $LOGFILE
2016-11-16 16:23:52 -06:00
cat $LOGFILE | mail -s "AniNIX::$(hostname) Update Candidates" sh1k0b4@gmail.com