Solved

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

Posted on 2014-02-02
2
338 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 37

Accepted Solution

by:
Gerwin Jansen earned 500 total points
Comment Utility
cp -rp /dir1/subdir1 /dir2

Then create tar in /dir2
0
 
LVL 8

Expert Comment

by:Surrano
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now