Results 1 to 3 of 3

Thread: preserve permissions while zip folders

  1. #1
    Join Date
    Oct 2019
    Beans
    1

    preserve permissions while zip folders

    Hello,
    How can I preserve permissions while compressing a folder using zip under Ubuntu?


  2. #2
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,532
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: preserve permissions while zip folders

    Welcome to the forums.

    The zip and unzip commands in the zip package are from Info-Zip and these normally preserve permissions where possible. An alternative would be to use a compressed tar, if that would meet your needs.

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    18,854
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: preserve permissions while zip folders

    Quote Originally Posted by mood86 View Post
    Hello,
    How can I preserve permissions while compressing a folder using zip under Ubuntu?

    The Unix-way would be to use tar and gzip from a root/sudo elevated account:

    Code:
    $ sudo tar czvf some-filename.tgz  relative-path-to-directory/
    tar should only be used for 500MB and less. For larger needs, use a real backup tool.

    As for zip and unzip or any other program running on any Unix, ownership and groups outside the current userid can only be maintained by either using root or sudo. Looking through the zip manpage, I don't see any mention at all about maintaining permissions, so every implementation could be different.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •