Solved

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

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

Suggested Solutions

Title # Comments Views Activity
Weird Samba Connectivity Issue... 7 40
SCP a file to multiple machines using a script 4 44
winscp where are logs stored 3 35
000webhost.com default error log 1 28
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Utilizing an array to gracefully append to a list of EmailAddresses
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…
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.

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