Skip to content

Instantly share code, notes, and snippets.

@worldwise001 worldwise001/

Last active Jun 13, 2019
What would you like to do? (ArchLinux)
timestamp=`date +%s`
pacupdate() {
yes | pacman -Scc
yes | pacman -Syu --ignore pacman,glibc,linux-lts,linux-lts-headers,linux,linux-headers,systemd,systemd-sysvcompat,libsystemd --noprogressbar &>> $logfile
yes | pacman -Scc
mkdir /var/log/autoupdate > /dev/null 2>&1
echo "=== START UPDATE AT $timestamp ===" > $logfile
echo >> $logfile
timed=$((time pacupdate) 2>&1)
echo >> $logfile
echo "Result: $result" >> $logfile
echo "$timed" >> $logfile
echo >> $logfile
echo "=== END UPDATE AT $timestamp ===" >> $logfile
cat $logfile | mail -s "pacman on $hostname" root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.