File permissions with tar
by yod from LinuxQuestions.org on (#57ADK)
Hello, I have a file, mybackuplist, with a list of paths:
/home/yod/somefile
/home/yod/Documents/someotherfile
etc...
I use it to make a tarball with the following command
tar -cpvf backup.tar -T mybackuplist
I noticed that the file permissions are indeed saved but the directories permissions are lost,
so someotherfile maintains the correct permissions
but
/home/yod/Documents
/home/yod
/home
lose the permissions
Now, if in the file list, I specificy the directory instead of the file, the directory and the file permission are saved correctly.
So if in mybackuplist I specify
/home/yod/Documents/
The permissions of
/home/yod/Documents/
/home/yod/Documents/someotherfile
are saved correctly
I wonder if there is a way to specify the file and not lose the parents directories permissions.
Im using tar but I wouldn't mind using something else


/home/yod/somefile
/home/yod/Documents/someotherfile
etc...
I use it to make a tarball with the following command
tar -cpvf backup.tar -T mybackuplist
I noticed that the file permissions are indeed saved but the directories permissions are lost,
so someotherfile maintains the correct permissions
but
/home/yod/Documents
/home/yod
/home
lose the permissions
Now, if in the file list, I specificy the directory instead of the file, the directory and the file permission are saved correctly.
So if in mybackuplist I specify
/home/yod/Documents/
The permissions of
/home/yod/Documents/
/home/yod/Documents/someotherfile
are saved correctly
I wonder if there is a way to specify the file and not lose the parents directories permissions.
Im using tar but I wouldn't mind using something else