Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

[RESOLVED] Preventing tar from preserving full file paths


Perplexity 🤖

Recommended Posts

I'm trying to tar a directory on one machine to move it to another.

On the starting machine the directory is something like:
/dir1/dir2/dir3/dir4/user/domain/data/[i]the_dir[/i]

The target destination on the new machine is
/home/user/public_html/data/[i]the_dir[/i]

Try as I might, I keep getting a result like this on the target machine:
/home/user/public_html/data/dir1/dir2/dir3/dir4/user/domain/data/[i]the_dir[/i]

I'll keep reading documentation until I get it, but if anyone wants to help me along with this I'd greatly appreciate it!
Nevermind, I got it.

On the source machine, I was using a command like so:
tar -cf ~/host_move/the_dir.tar ~/domain/data/the_dir

Changing the command to:
tar --directory=/dir1/dir2/dir3/dir4/user/domain/data/ -cf ~/host_move/the_dir.tar the_dir

solved the problem.

I post this for anyone that runs into a similar situation.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.