[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

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

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
andieje
Asked:
andieje
1 Solution
 
Gerwin Jansen, EE MVETopic Advisor Commented:
cp -rp /dir1/subdir1 /dir2

Then create tar in /dir2
0
 
SurranoCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now