Tar is not filling my directories

I destroyed my system and am trying to rebuild it. I have many incremental saves and initially picked one that did not contain everything.

I now have an archive that contains all of the files in my home directory. I want to extract it to my home and retain newer versions of the files.

The extraction command I am using is

“tar -xvjf home.21-05-20.tar.bz2”

This should be pretty standard. What I am seeing is that directories have been created, but even though the tar listing shows that tar goes by the files, they are not being updated and I don’t understand why.

In particular: /home/jc/Pictures is present and I can see that should go in the directories pass by, the directory remains empty. There any many other directories where this is happening.

What am I doing wrong?

It may be the working directory when giving the command.

The tar file contains files relative to some directory and if you don’t do a cd to that directory before extracting, the files will be created somewhere else.

Even if you used absolute paths when creating the tar file, the leading “/” will be omitted in the tar file for security reasons and you need a cd / before extracting.

1 Like

You were right! All of the articles I googled were toy cases. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.