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.
I am facing some odd and maybe abnormal situation while backup files and directories from ext4 partitions to a smb/cifs network share whose partition is formated with ntfs.
=> some times the command preserve the timestamp, more often than not it does not preserve them -– same type of filesystems (ext4 => ntfs/cifs share)
It seems to copy everything (no incremental backup though, it is everything) and at the end it outputs the following:
sent 21.92G bytes *received 1.14M bytes *19.61M bytes/sec
total size is 23.51G *speedup is 1.07
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2
.7]
Upon issue the command “du -BM -c”, at the end, the command outputs about 82GB which non-sense given that /opt only has about 23GB.
On the other hand if I used the following command:
ls -lR | awk '{ sum += $5 } END{ print sum } ' | awk '{print $1 / (1000*1000*1000) *}'
it outputs the right/expected amount: about 23GB.
So, the quandaries: 1) sometimes preserve and other times it does not preserve timestamps; 2) completely out of the wacky output from “du” for the cifs share; 3) no incremental backup (it always copies everything over and over); 4) the warning at the end, “rsync error: some files/attrs were not transferred (see previous errors) (code 23) “ at first does not add up since I did not request to have permissions transferred with the command issued, no --perms or -p parameter (likely it would not work with dissimilar filesystems)
Note: the system used is Slackware64 current.
Note: "rsync --version" return the following:
rsync version 3.2.7 protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.
#1 rsync is a file and folder synchronization tool, not a backup tool. It has no provision for storing data not preserved by the file systems.
#2 NTFS does not support Unix style file and folder timestamp data. EXT4 (and other Unix style file systems) will not support Microsoft style timestamps. Some utilities try to translate between them, but that is an uncertain kludge at best.
True backup software (like archive utilities) can capture that data AND METADATA intact, but does so to a tape or archive capsule. (Tar does this, for example.)
CIFS/SMB and NFS add another translation layer between, and I never recommend using them for backups if you have a better option.
ZABIX, BACKULA, and other enterprise level backup and recovery tools take care of this and allow direct over network backups from multiple operating systems, but are complex and overkill for the non-enterprise case.
If you are a competent Unix/Linux Admin I recommend doing compressed imaging for quarterly backups, and a burp server for your frequent backups to enable single file or folder restore and point-in-time recovery. (Burp uses rsync libraries to reduce traffic, deduplication at the block level, and compression to reduce storage requirements and speed up incremental backups.) It does require having a spare platform you can dedicate to backup storage use, and familiarity with ssh key base security.
The "*" before --times was a typo. I issued the command as state in my first post without the typo and the same issue present itself.
The device hosting the shared drive (flash drive, formated with ntfs) is actually a Nighthawk RAX120V2 router. I would imagine that it is smb2 or smb3.
#1 rsync is a file and folder synchronization tool, not a backup tool. It has no provision for storing data not preserved by the file systems.
#2 NTFS does not support Unix style file and folder timestamp data. EXT4 (and other Unix style file systems) will not support Microsoft style timestamps. Some utilities try to translate between them, but that is an uncertain kludge at best.
True backup software (like archive utilities) can capture that data AND METADATA intact, but does so to a tape or archive capsule. (Tar does this, for example.)
CIFS/SMB and NFS add another translation layer between, and I never recommend using them for backups if you have a better option.
ZABIX, BACKULA, and other enterprise level backup and recovery tools take care of this and allow direct over network backups from multiple operating systems, but are complex and overkill for the non-enterprise case.
If you are a competent Unix/Linux Admin I recommend doing compressed imaging for quarterly backups, and a burp server for your frequent backups to enable single file or folder restore and point-in-time recovery. (Burp uses rsync libraries to reduce traffic, deduplication at the block level, and compression to reduce storage requirements and speed up incremental backups.) It does require having a spare platform you can dedicate to backup storage use, and familiarity with ssh key base security.
Thanks for the insights.
Currently, I am using a powerful router (rav120v2) to host the drive been shared. So, it is very limited in terms of configuration, modification, fine tuning, etc. I also have a dedicate NAS (buffalo), but that also is limited. I was cogitating the use of a real linux box as file server (small computer device with raid and low power consumption), but that is something for the near future.
Imaging whole partition is certainly good idea as well for a full back every few months. Since in my case the /home and /opt (install third party software) are in dedicated partitions that would be easier.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.