tar options to make a complete backup


tar -pczvf backup.tgz dir
  • p = preserve permissions (so executables stay executable)
  • c = create
  • z = compress
  • v = verify
  • f = to a named file

It is important to use a directory name, not a file name. Otherwise, it will not include dot files.

source

Tags:  bash

Share: