[SOLVED] Folder and file permissions in back-up not the same as in the source
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Folder and file permissions in back-up not the same as in the source
I am using ubuntu 11.10. I have several files and folders in a particular folder. The list of files and folders in that folder is shown below.
I have backed-up all these folders and files into external hard-drive. I used rsync command to do the back up. The command I used is 'rsync -av --progress --size-only [source] [destination].
The information on each file and folders that I copied into external hard drive is not the same. The first column, second column, and fifth column seems do not preserve all the attributes corresponding to each files. For example in fifth column I can see some folders have value 4096 and 48. This is not consistent with the source folders.
My question: Is this normal in doing files and folders back-up? Or, is there something wrong the way I transferred the data. Or something else.
I don't want to loose any data from my external hard drive. Could anyone explain what actually getting wrong here?
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive recurse into directories
-l, --links copy symlinks as symlinks
-p, --perms preserve permissions
-g, --group preserve group
-o, --owner preserve owner (super-user only)
-D same as --devices --specials
-ignore-existing skip updating files that exist on receiver
-S, --sparse
Try to handle sparse files efficiently so they take up less space on the destination. Conflicts with
--inplace because it’s not possible to overwrite data in a sparse fashion.
NOTE: Don’t use this option when the destination is a Solaris “tmpfs” filesystem. It doesn’t seem to han-
dle seeks over null regions correctly and ends up corrupting the files.
did you run rsync as user or root, or as a different user then on your directory?
i typically will run rsync -aviS source destination, but that is just me. when i do that as user, i never have permissions issues as you did above.
using '-a' should mean that you get the '-p' behaviour and hence preserve permissions, but we can see that the group and other permissions are not preserved. The fifth column should be the size of the files. So the fact the the directories show "0" is quite strange. Have you actually checked the files?
What file systems are you using?
Also you may find it useful to run rsync with a high level of verbosity and check what is written to the terminal.
Another point is, that I think you should probably not use the --size-only option as it would cause rsync to skip modified files if their size is unchanged.
When I check the contents of the folders and files, they are present as in the source files and folders. But their attributions are also not consistent with the source files.
In Ubuntu I am using ext4 file system. But my external hard drive file system is NTFS.
compression with rsync is only during transport
i.e. compress file > send to dest > uncompress
It actually depends on how important the permissions are to you,
as it stands the only really difference is you have no 'group' or 'other' bits set
You will still be able to read them
.. Sorry just noticed you lost execute on make-directory.sh
Other options are partition the drive up into two
one ntfs and one ext4
You could also make a loopback filesystem, i.e. one bigfile, 'format' it ext4 and mount with loop option.
end of the day it is probably easier to use tar
Code:
tar -c ./ -f /path/to/backup.tar
optionally use compression ( see man tar for details )
But as I said earlier, it really depends on what these files are used for.
Dear evo2,
When I check the contents of the folders and files, they are present as in the source files and folders. But their attributions are also not consistent with the source files.
OK.
Quote:
In Ubuntu I am using ext4 file system. But my external hard drive file system is NTFS.
What is your advice on this could be?
Avoid NTFS (and similar deficient filesystems) like the plague.
Sadly NTFS will cause these issues. Not much to be done about it other then not use it. Either split the drive or just deal with the permissions issue caused by the lack of control provided by NTFS
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.