Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Creating a tar or zip of a folder with no write access

Posted on 2014-02-02
2
351 Views
Last Modified: 2014-02-03
Hello

I have this file structure

/dir1/subdir1
/dir2

I have full access on dir2 but only read and execute access on dir1. There is no write access for some reason. I am trying to zip and/or tar subdir1 with the output destination of the file as dir2.  I get an error in both cases relating to IO and permissions. I was hoping I might be able to zip/tar the files even though i don't have write permission to dir1 if I had write permission to the output location. Is there a way around this?

Thanks a lot
0
Comment
Question by:andieje
2 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 500 total points
ID: 39827914
cp -rp /dir1/subdir1 /dir2

Then create tar in /dir2
0
 
LVL 8

Expert Comment

by:Surrano
ID: 39831730
I can't see why any of these wouldn't work; have you tried?

zip -r9 /dir2/my.zip /dir1/subdir1
tar czf /dir2/my.tgz /dir1/subdir1

Open in new window


(please don't reopen the question, just an afterthought)
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question