tar -pczvf backup.tgz dir
It is important to use a directory name, not a file name. Otherwise, it will not include dot files.
To backup only specific files, create a files.txt with find and then pass --from-file files.txt instead of dir
files.txt
find
--from-file files.txt
dir
source
Date: 2019-08-10
Tags: bash
Share: