Skip to content

Instantly share code, notes, and snippets.

@dmitryhd
Last active September 16, 2016 07:33
Show Gist options
  • Select an option

  • Save dmitryhd/f0df917433f11b29ab33 to your computer and use it in GitHub Desktop.

Select an option

Save dmitryhd/f0df917433f11b29ab33 to your computer and use it in GitHub Desktop.
directory backup
tar -czf - ./dir | (pv -p --timer --rate --bytes > backup/$(date +"%Y.%d.%m-%H.%M").tgz)
A quick way of backing up a list of programs is to run this:
dpkg --get-selections > ~/Package.list
sudo cp -R /etc/apt/sources.list* ~/
sudo apt-key exportall > ~/Repo.keys
It will back them up in a format that dpkg can read* for after your reinstall, like this:
sudo apt-key add ~/Repo.keys
sudo cp -R ~/sources.list* /etc/apt/
sudo apt-get update
sudo apt-get install dselect
sudo dselect update
sudo dpkg --set-selections < ~/Package.list
sudo apt-get dselect-upgrade -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment