[SOLVED] What rsync command should I use for maximum preservation?
UbuntuThis forum is for the discussion of Ubuntu Linux.
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.
Like my main concern about using rsync is if I overwrite rsync, what happens to that running program with restore. With that reply I assume it would keep running fine. X E.
Last edited by maybeJosiah; 01-11-2024 at 01:02 PM.
Reason: rsync not it maybe
This is similar to how things work on, say, MS-DOS, but in Linux this $PATH will basically never include the current directory.
The bottom line is that it will only execute the copy of rsync that's from the currently running OS, and never any other copy of rsync unless you for some (stupid) reason specify otherwise with a full path or relative path to some other copy of rsync.
Like my main concern about using rsync is if I overwrite rsync, what happens to that running program with restore. With that reply I assume it would keep running fine. X E.
In general overwriting a file which is currently in use is not a good idea, that may have strange side effects.
In such cases, the operating system may continue to run the copy in RAM, as long as the system does not attempt to access the original file on disk. This can cause an instant crash (of that app).
There is no danger with rsync. For example, if you have /usr/bin/rsync on disk and want to restore a different version from backup: rsync copies to file name /usr/bin/rsync.NKnduM (last six characters are random). Only when done copying, it renames it to /usr/bin/rsync. So, it doesn't use the old file's inode but creates a separate one. The running rsync process continues to use the old binary on disk and the old inode is removed from the disk only after the last user stops using it.
The only real difference between -vrlDAXHxog and -vaxHAX is that the latter preserves mtime. But for some reason you want to set it yourself.
By the way. If you use 'rsync -av' (mtime preserved) and you interrupt copying, another 'rsync -av' continues from that. Or if you change some files and run 'rsync -av' again, it will only transfer the new changed files.
But your command 'rsync -vrlDAXHxog' (mtime not preserved) will always start from the beginning and copy everything again after an interrupt.
Quote:
Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time.
Last edited by Petri Kaukasoina; 01-12-2024 at 05:56 AM.
... if you change some files and run 'rsync -av' again, it will only transfer the new changed files.
That is why I like 'rsync -av --delete' as it only transfers/deletes files that have changed. Subsequent backups are a lot quicker than the first one to keep everything in sync.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.