Originally Posted by alenD
when i use
tar cvzf mytar.tgz mydir
as as a user i get
tar: mytar.tgz: Cannot open: Permission denied
when i do the same as root it works fine
when, as a user, i enter mydir and do
tar cvzf mytar.tgz *
everything works fine again
i changed the permissions of mydir but the problem seems to be somewhere else. .. but cannot figure out where?
The permissions on the directory you're in allow read, but not write. When you go into the mydir directory, you've obviously got write permissions.
Either chown the upper-level directory to be owned by you, or chmod it to allow writing by your user ID's group.