ShadowArch/Admin/arch-update
2016-11-16 16:23:52 -06:00

30 lines
894 B
Bash
Executable File

#!/bin/bash
export LOGFILE="/var/log/sysupdate.log"
date > $LOGFILE
# Update
echo == Updating Arch Packages == >> $LOGFILE
# pacman -Syu --noconfirm 2>&1 >> $LOGFILE # I've been having troubles with this causing crashes while online.
checkupdates >> $LOGFILE
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
cat $LOGFILE | mail -s "AniNIX::$(hostname) Update Candidates" sh1k0b4@gmail.com