Linux Automation: Difference between revisions

From Coolscript
Jump to navigation Jump to search
Line 10: Line 10:
  unattended-upgrade --dry-run -d
  unattended-upgrade --dry-run -d


==Automatic update using crontab=
=Automatic update using crontab=
  #echo 'MAILTO=""' > mycron
  #echo 'MAILTO=""' > mycron
  #echo "00 05 * * * apt-get update && apt-get -y upgrade -s | logger  
  #echo "00 05 * * * apt-get update && apt-get -y upgrade -s | logger  
  #crontab mycron
  #crontab mycron
  #rm mycron
  #rm mycron

Revision as of 20:14, 14 December 2020

Setup a proxy server for apt

echo 'Acquire::http::Proxy "http://myserver.com.com:port";' > /etc/apt/apt.conf

Update using apt

apt-get -y  upgrade -s
apt-get -y  upgrade -s; logger "APT has been applied"
unattended-upgrade --dry-run -d

Automatic update using crontab

#echo 'MAILTO=""' > mycron
#echo "00 05 * * * apt-get update && apt-get -y upgrade -s | logger 
#crontab mycron
#rm mycron