On Thu, 21 Sept 2023 at 02:01, Frank Steinmetzger <war...@gmx.de> wrote: > > $ tar -cpf /path/to/backup.tar --xattrs --xattrs-include='*.*' -C / . > > Does that stop at file system boundaries (because you tar up '/')? I think > it must be, otherwise you wouldn’t use it that way. No, it doesn't. It will archive everything recursively including mounted directories, so fair point for raising this. It's something that I do not normally consider, as I tend not to do full root backup on the running system itself. But how cool is using bind mount for this situation as you suggest? Simple and effective, I like it.
Actually, the presence of -C in the above example is purely out of habit. I use it when pointing to a full path, e.g. "/path/to/dir" so it doesn't end up creating the "path/to/dir" path prefix inside the archive and only archives the contents of the path. It's effectively changing to that directory and archiving everything there, but saves you from doing the "cd". Naturally, for "/" this is superfluous and "-C / ." can be replaced with just "/". > > Provided backup space isn't an issue, I wouldn't bother with > > compression. It could be a lot quicker too depending on the size of > > your root partition. > > Or not, depending on the speed of the backup device. ;-) > LZO compression (or zstd with a low setting) has negligible CPU cost, but > can lower the file size quite nicely, specially with large binaries or debug > files. > That's true :) I had somehow forgotten of tar's support for LZO and zstd as my default finger memory approach is to use -J for xz. Good memory nudge here! Regards, V