Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####backup.sh######
- #!/bin/bash
- dpkg --get-selections | awk '!/deinstall|purge|hold/ {print $1}' > ./packages.list.save
- apt-mark showauto > ./package-states-auto
- apt-mark showmanual > ./package-states-manual
- #apt-clone clone --with-dpkg-repack aptBackupKomplett
- #copy groups and users
- awk -F: '($3>=1000) && ($3<65534)' /etc/passwd > passwd.move
- awk -F: '($3>=1000) && ($3<65534)' /etc/passwd | cut -d: -f1 | egrep -f - /etc/shadow > shadow.move
- awk -F: '($3>=1000) && ($3<65534)' /etc/group > group.move
- cp /etc/gshadow gshadow.move
- cp /etc/apt/trusted.gpg trusted-keys.gpg
- 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