ShadowArch/Admin/arch-update
2016-11-09 22:25:00 -06:00

34 lines
886 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
echo >> $LOGFILE
# Get AUR list of update candidates
echo == AUR Candidate List == >> $LOGFILE
cower -u >> $LOGFILE
echo >> $LOGFILE
# Clean cache
echo == Cleaning Cache == >> $LOGFILE
paccache -r >> $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 log" sh1k0b4@gmail.com