Friday, August 27, 2010

debian backup script love

from tso:


cat /var/lib/dpkg/info/*.list | sort -u > /tmp/all-dpkg-files
cat /var/lib/dpkg/info/*.conffiles | sort -u > /tmp/all-conf-files
comm -23 /tmp/all-dpkg-files /tmp/all-conf-files | perl -n -e "chomp;" -e 'print "$_\n" if -f;" > /tmp/exclude-files
echo /var/cache >> /tmp/exclude-files
echo /tmp >> /tmp/exclude-files
echo $HOME >> /tmp/exclude-files
tar -c -v -f - --exclude-from /tmp/exclude-files / | bzip -9 > ~/my-machine-backup.tar.bz2
dpkg -l > ~/my-debian-packages.list

No comments:

Post a Comment

#RSFtalks with Edward Snowden

What an intelligent, thoughtful individual. I find it difficult to forgive 44 for failing to pardon this patriot and instead pursuing him ...

Other Popular Posts: