Skip to content

Instantly share code, notes, and snippets.

@farkasmate
Created November 7, 2018 16:02
Show Gist options
  • Select an option

  • Save farkasmate/1ca5d805a1fe4531c504d0a9dd5f8653 to your computer and use it in GitHub Desktop.

Select an option

Save farkasmate/1ca5d805a1fe4531c504d0a9dd5f8653 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# != 1 ]
then
echo "Usage: $(basename $0) <backup.cpio.gz>"
exit 1
fi
dir="restored-$(basename $1)"
mkdir $dir
cat $1 | gunzip --to-stdout | cpio --extract --quiet --no-absolute-filenames --make-directories --directory $dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment