Advertisement
sergio_educacionit

apt_maintainter.sh

Oct 5th, 2024 (edited)
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.61 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. log=/var/log/apt_maintainter.log
  5.  
  6.  
  7. echo "$(date +"%Y-%m-%dT%H:%M:%S%Z") - Inicia script de mantenimiento de paquetes..." >> $log
  8.    
  9. apt update
  10.  
  11. echo "$(date +"%Y-%m-%dT%H:%M:%S%Z") - Base de datos de paquetes actualizada." >> $log
  12.  
  13. apt install -f -y
  14.  
  15. echo "$(date +"%Y-%m-%dT%H:%M:%S%Z") - Instaladas dependencias falatantes." >> $log
  16.  
  17. apt upgrade -y
  18.  
  19. echo "$(date +"%Y-%m-%dT%H:%M:%S%Z") - Actualizado el sistema." >> $log
  20.  
  21. apt autoremove -y
  22.  
  23. echo "$(date +"%Y-%m-%dT%H:%M:%S%Z") - Eliminadas dependendencias huerfanas." >> $log
  24.  
  25. echo "$(date +"%Y-%m-%dT%H:%M:%S%Z") - Terminado." >> $log
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement