1
Peekay
TAR Files. Are owner and group settings changed on upload?
  • 2005/11/9 16:54

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Sorry if this is a dumb question, but...

When you create a TAR file locally and then decompress it on a remote server, what happens to the 'local' owner and group settings for files and folders in the archive?. Are they automatically changed to the remote server's default user and group when the archive is decompressed?

Also, will the permissions set for files and folders in the archive be retained, or will they be overwritten with the remote server defaults?

I can't test this myself at the moment and wondered if anyone could enlighten me in advance of trying it.
A thread is for life. Not just for Christmas.

2
Peekay
Re: TAR Files. Are owner and group settings changed on upload?
  • 2005/11/9 21:21

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Quote:
Also, will the permissions set for files and folders in the archive be retained, or will they be overwritten with the remote server defaults?

Answered that one. Apparently, adding the 'P' parameter to the decompress command retains the existing permissions. (so I am told)

tar xvfpz filename.tar

Be interested to know about the owner and group issue?.
A thread is for life. Not just for Christmas.

3
Peekay
Re: TAR Files. Are owner and group settings changed on upload?
  • 2005/11/14 12:21

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Quote:
When you create a TAR file locally and then decompress it on a remote server, what happens to the 'local' owner and group settings for files and folders in the archive?.

The answer is... they get changed.

Unfortunately, adding the 'P' to the TAR command to preserve permissions doesn't seem to work with my host anyway. Folders and files are also given the host's defaults (755 and 644).

A thread is for life. Not just for Christmas.

4
Dave_L
Re: TAR Files. Are owner and group settings changed on upload?
  • 2005/11/14 16:49

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


tar has an option "--same-owner" that preserves the owner, but you might have to be "root" to use it.

5
gediminasbyt
Re: TAR Files. Are owner and group settings changed on upload?

Don't forget permissions are transfered by UID, not the name. Let's say the user on system1 'tom' has UID of 505, you transfer tar files to different host and there is no user tom, files will be created with the owner of 505 not tom. You can safely do chown -R tom for that directory (after you created him on new host).

Gediminas

Login

Who's Online

238 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 238


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits