JYPDWhite

Untitled

Feb 2nd, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. ####backup.sh######
  2. #!/bin/bash
  3. dpkg --get-selections | awk '!/deinstall|purge|hold/ {print $1}' >  ./packages.list.save
  4. apt-mark showauto >  ./package-states-auto
  5. apt-mark showmanual >  ./package-states-manual
  6.  
  7. #apt-clone clone --with-dpkg-repack aptBackupKomplett
  8.  
  9. #copy groups and users
  10. awk -F: '($3>=1000) && ($3<65534)' /etc/passwd > passwd.move
  11. awk -F: '($3>=1000) && ($3<65534)' /etc/passwd | cut -d: -f1 | egrep -f - /etc/shadow > shadow.move
  12. awk -F: '($3>=1000) && ($3<65534)' /etc/group > group.move
  13. cp /etc/gshadow gshadow.move
  14. cp /etc/apt/trusted.gpg trusted-keys.gpg
  15.  
  16.  
  17. rsync  -avzh --progress --numeric-ids -e ssh --exclude-from 'exclude.txt' / root@1337.1337.1337.42:/root/backup
Advertisement
Add Comment
Please, Sign In to add comment