Skip to content

Instantly share code, notes, and snippets.

@l2dy
Last active November 17, 2016 16:23
Show Gist options
  • Save l2dy/33d7bea50724685e20275249e08264c0 to your computer and use it in GitHub Desktop.
Save l2dy/33d7bea50724685e20275249e08264c0 to your computer and use it in GitHub Desktop.

run-as com.example.app tar -cf - . | cat >backup.tar

cat backup.tar | run-as com.example.app tar -xf -

run-as: Usage:
    run-as <package-name> [--user <uid>] <command> [<args>]
usage: tar -[cxtzhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR]

Create, extract, or list files from a tar file

Operation:
c Create
f Name of TARFILE ('-' for stdin/out)
h Follow symlinks
m Don't restore mtime
t List
v Verbose
x Extract
z (De)compress using gzip
C Change to DIR before operation
O Extract to stdout
exclude=FILE File to exclude
X File with names to exclude
T File with names to include
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment