Advertisement
Guest User

update.sh Nicolas

a guest
Dec 7th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. .scripte]$ cat update.sh
  2.  
  3.  
  4. #!/bin/bash
  5. # System Update
  6. # ---------------------------
  7. # Snapshot - Rollback - Btrfs
  8. # ---------------------------
  9.  
  10. MV=/usr/bin/mv
  11. BTRFS=/usr/bin/btrfs
  12. SED=/usr/bin/sed
  13. PACMAN=/usr/bin/pacman
  14. PACAUR=/usr/bin/pacaur
  15. CP=/usr/bin/cp
  16. REFLECTOR=/usr/bin/reflector
  17.  
  18. # ---------------------------
  19. # Snapshot System
  20. # ---------------------------
  21.  
  22. # -------- OLDSTABLE --------
  23.  
  24. $BTRFS subvolume delete /.snapshots/OLDSTABLE
  25. $MV /.snapshots/STABLE /.snapshots/OLDSTABLE
  26. $SED -i 's/STABLE/OLDSTABLE/g' /.snapshots/OLDSTABLE/etc/fstab
  27. $CP /boot/vmlinuz-linux-stable /boot/vmlinuz-linux-oldstable
  28. $CP /boot/initramfs-linux-stable.img /boot/initramfs-linux-oldstable.img
  29.  
  30. # --------- STABLE ----------
  31.  
  32. $BTRFS subvolume snapshot / /.snapshots/STABLE
  33. $SED -i 's/TESTING/STABLE/g' /.snapshots/STABLE/etc/fstab
  34. $CP /boot/vmlinuz-linux /boot/vmlinuz-linux-stable
  35. $CP /boot/initramfs-linux.img /boot/initramfs-linux-stable.img
  36.  
  37. # ---------------------------
  38. # Update System
  39. # ---------------------------
  40.  
  41. $REFLECTOR --verbose -l 5 -p https --sort rate --save /etc/pacman.d/mirrorlist
  42. $PACMAN -Syu
  43.  
  44. # ---------------------------
  45. # Balance Filesystem
  46. # --------------------------
  47.  
  48. $BTRFS balance start -dusage=5 /btrfs
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement