Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Due to a first rsync "error" where I have two files with the
"same" name "Linux" and "linux", rsync always get confused when I do
subsequent rsync, even though I have merged Linux and linux and remove the redundant file. How can I ask rsync to forget the former mistakes ?
Thanks. I think --delete is a neat way to preserve identical content
between the source and the dest. Your "wipe out" actually means wiping out some files in the destination directory.
I did some simple tests, I still cannot explain the behavior I have
seen in the first post. I mean it should not happen since I have delete
one file from the source directory. Well, I think there is some weird things that is very subtle.
Anyway, I think from now on I will use --delete whenever I can.
but I have another copy of that under junk-summ. I removed the redundancy in summary/, but not the ones in junk-summ, hence it created an illusion
that something is wrong with rsync. So rsync is working fine, of course!
At least I figured out the mystery, bummer!!
Another, the "--delete " is a good way of making identical copy, appreciate propofol's comment !
The --delete option can also be dangerous. If you accidentally type the wrong source directory name, you could end up deleting all the target files (and have to reload everything all over again).
The --dry-run option is useful to test with to make sure you are doing what you think you are doing. Then recall the command and pull off the --dry-run option when ready to do it.
Something that often happens to people is that they run rsync a second time and find they have a duplicate file tree of their files inside the target directory, with a name the same as the directory. This is because rsync follows the legacy Unix behaviour of putting a source directory INSIDE a target directory when the target already exists. To make this not happen, simply append "/." to the source directory name. This causes rsync to access "." inside the target directory, which is the target itself. You can also use this trick on cp and scp commands.
The --delete option can also be dangerous. If you accidentally type the wrong source directory name, you could end up deleting all the target files (and have to reload everything all over again).
Very true, especially when important files that are supposed to be duplicated are
destroyed (such as months of simulation results and that is the only copy). It is also true with the basic cp.
Since I just learned rsync, I choose to alias the rsync command and intend to restrict the number of such
aliases.
I notice that between two machines with different rsync versions, it is
only possible to issue rsync command on the machine with a newer version.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.