?
Solved

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

Posted on 2014-02-02
2
Medium Priority
?
361 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
[X]
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
2 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 2000 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

770 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