{"id":4848,"date":"2026-08-29T19:40:32","date_gmt":"2026-08-29T10:40:32","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/safe-rsync-backup-guide-2\/"},"modified":"2026-08-29T19:40:33","modified_gmt":"2026-08-29T10:40:33","slug":"safe-rsync-backup-guide","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/linux-server-network\/safe-rsync-backup-guide\/","title":{"rendered":"Easy Data Backup with rsync: How to Do It Safely While Monitoring Progress"},"content":{"rendered":"<p>Today, I&#8217;d like to talk about &#8220;rsync,&#8221; a handy tool for data backing up. rsync is a command-line tool that is extremely useful for file synchronization and backup. It is especially powerful for those who want to perform backups while checking the progress status.<\/p>\n<h2>Basics and Precautions of rsync<\/h2>\n<p>First, let&#8217;s go over some basic precautions when using rsync.<\/p>\n<ol start=\"1\">\n<li>Data Integrity: Since rsync transfers file differences, it is important to ensure that the data at the source and destination match.<\/li>\n<li>Permissions and Ownership: By using the <code>-a<\/code> option, you can transfer files while preserving their permissions and ownership.<\/li>\n<li>Deletion Option: To delete files from the destination that do not exist at the source, use the <code>--delete<\/code> option.<\/li>\n<li>Network Load: Transferring large amounts of data can put a load on the network. Use the option to limit the transfer speed (<code>--bwlimit<\/code>) as needed.<\/li>\n<\/ol>\n<h2>Options for Displaying Progress<\/h2>\n<p>To display the progress of rsync, use the <code>--progress<\/code> option. You can also add the <code>-v<\/code> option to show detailed information.<\/p>\n<h3>Command Example<\/h3>\n<p>Below is an example of a command that uses rsync to back up data and display the progress:<\/p>\n<div>\n<div>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>rsync -avh --progress \/path\/to\/source\/ \/path\/to\/destination\/<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<ul>\n<li><code>-a<\/code>: Archive mode. Preserves directory structure, symbolic links, permissions, timestamps, owner, group, and special files.<\/li>\n<li><code>-v<\/code>: Verbose mode. Displays a list of files being transferred.<\/li>\n<li><code>-h<\/code>: Outputs in a human-readable format (e.g., displaying sizes in KB, MB, GB).<\/li>\n<li><code>--progress<\/code>: Displays the transfer progress of each file.<\/li>\n<\/ul>\n<h2>Behavior Differences Based on the Presence of a Trailing Slash<\/h2>\n<p>It is also important to understand how rsync behaves differently depending on whether or not a trailing slash is included.<\/p>\n<h3>With a Trailing Slash (<code>\/<\/code>)<\/h3>\n<ul>\n<li>Source: Copies only the contents of the directory.<\/li>\n<li>Destination: Copies the contents directly inside the destination directory.<\/li>\n<\/ul>\n<p>For example, consider the following command:<\/p>\n<div>\n<div>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>rsync -avh --progress \/path\/to\/source\/ \/path\/to\/destination\/<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>In this case, the contents (files and subdirectories) inside the <code>\/path\/to\/source\/<\/code> directory are copied directly into the <code>\/path\/to\/destination\/<\/code> directory.<\/p>\n<h3>Without a Trailing Slash<\/h3>\n<ul>\n<li>Source: Copies the directory itself, including its root.<\/li>\n<li>Destination: Copies the entire directory into the destination directory.<\/li>\n<\/ul>\n<p>For example, consider the following command:<\/p>\n<div>\n<div>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>rsync -avh --progress \/path\/to\/source \/path\/to\/destination\/<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>In this case, the <code>\/path\/to\/source<\/code> directory itself is copied inside the <code>\/path\/to\/destination\/<\/code> directory, resulting in the creation of a directory named <code>\/path\/to\/destination\/source\/<\/code>.<\/p>\n<h2>Summary<\/h2>\n<ul>\n<li>With a slash: Copies only the directory contents.<\/li>\n<li>Without a slash: Copies the directory itself.<\/li>\n<\/ul>\n<p>By understanding this difference and using the rsync command appropriately, you can perform backups and synchronizations exactly as intended.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, I&#8217;d like to talk about &#8220;rsync,&#8221; a handy tool for data backing up. rsync is a command- [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1074,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=172","footnotes":""},"categories":[1170],"tags":[663,251],"class_list":["post-4848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-server-network","tag-663","tag-251","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=4848"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4848\/revisions"}],"predecessor-version":[{"id":4851,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4848\/revisions\/4851"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/1074"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=4848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=4848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=4848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}