Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

The Power of Rsync: Efficient File Synchronization for Linux

Posted on Jul 25 Rsync is a powerful utility for file synchronization in Linux that allows you to efficiently Copy and synchronize files between local and remote locations. In this article, we'll explore some of the most commonly used rsync commands and their practical applications.To copy a single file from the source to the destination, use the following command:To copy a folder and its contents recursively, use the -r option:The -a option (archive mode) preserves file permissions, timestamps, and more during the copy operation:For a more verbose output that lists the files being copied and the progress, use the -v (verbose) option:Alternatively, use the --progress option for a human-readable progress indicator:For a human-readable progress display, add the -h option:When dealing with large files, use the --partial option to allow for partial copies. This enables you to resume interrupted transfers:Alternatively, the -P option is a shorthand for --partial --progress.To sync files and delete items in the destination that no longer exist in the source, add the --delete option:To automatically delete files from the source after a successful copy, use the --remove-source-files option:Note: This won't delete source folders, so an additional step is required, you can use $ find like -type d -empty -deleteTo sync files from a local machine to a remote server, use the following syntax:Archiving Before Sync:Archiving can be useful to preserve attributes and reduce the amount of data transferred. To archive a remote folder before syncing, use:If the SSH port is non-default (e.g., 22), specify it using the -e option:Rsync is a tool for efficiently managing file synchronization tasks on Linux systems. With its flexibility and numerous options, it empowers users to handle a wide range of data synchronization requirements with ease.Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Prakash Tiwari - Jun 4 Toby Chui - Jun 4 Satoru Takeuchi - Jun 2 Shiva Prasad Gajula - May 31 Once suspended, Saeedeldeeb will not be able to comment or publish posts until their suspension is removed. Once unsuspended, saeedeldeeb will be able to comment and publish posts again. Once unpublished, all posts by saeedeldeeb will become hidden and only accessible to themselves. If saeedeldeeb is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to saeedeldeeb. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag saeedeldeeb: saeedeldeeb consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging saeedeldeeb will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

The Power of Rsync: Efficient File Synchronization for Linux

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×