{"id":2481,"date":"2023-03-18T00:34:04","date_gmt":"2023-03-17T19:04:04","guid":{"rendered":"https:\/\/smarttech101.com\/?p=2481"},"modified":"2023-08-17T15:02:21","modified_gmt":"2023-08-17T09:32:21","slug":"backup-and-restore-your-computer-using-rsync","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/","title":{"rendered":"Backup and Restore Your Computer Using Rsync"},"content":{"rendered":"\n<p><a href=\"https:\/\/rsync.samba.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Rsync<\/a> is a Free, Open Source, and Minimalistic tool which enables you to copy and paste all files with all their attributes. It is fast and quite versatile. You can use rsync to back up and restore your computer. It is better than the basic <a href=\"https:\/\/smarttech101.com\/copy-command-cp-in-linux-unix\/\" target=\"_blank\" rel=\"noreferrer noopener\">copy command <code>cp<\/code><\/a> because it provides many more options than those by <code>cp<\/code>. It is the best backup tool since it allows you to include\/exclude the directories you want. Other backup tools don&#8217;t let this and thus increase the backup size. They are also very slow.<\/p>\n\n\n\n<p>In this article, I will give you two commands for backup and restore. Then I will guide you on how you can create a simple script and cronjob for periodic backup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Table of Contents<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#how_to_backup_your_linux_computer_using_rsync\">How to backup your Linux Computer using Rsync<\/a><\/li>\n\n\n\n<li><a href=\"#how_to_restore_your_linux_computer_using_rsync\">How to restore your Linux computer using Rsync<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#steps_to_restore_your_computer\">Steps to restore your computer:<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#creating_script_for_backup_and_restore_using_rsync_in_linux\">Creating script for backup and restore using rsync in Linux<\/a><\/li>\n\n\n\n<li><a href=\"#creating_a_cronanacron_job_for_periodic_backup_using_rsync\">Creating a cron\/anacron job for periodic backup using rsync<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#rsync_backup_using_crontab_e\">Rsync backup using crontab -e<\/a><\/li>\n\n\n\n<li><a href=\"#rsync_backup_using_etccrontab\">Rsync backup using \/etc\/crontab<\/a><\/li>\n\n\n\n<li><a href=\"#rsync_backup_using_anacrontab\">Rsync backup using anacrontab<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_backup_your_linux_computer_using_rsync\">How to backup your Linux Computer using Rsync<\/h2>\n\n\n\n<p>The command I use is the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo rsync --archive --acls --xattrs --hard-links --verbose --delete --log-file=\/rsync.log --exclude={\"\/dev\/*\",\"\/proc\/*\",\"\/sys\/*\",\"\/tmp\/*\",\"\/run\/*\",\"\/mnt\/*\",\"\/media\/*\",\"\/lost+found\",\"\/swapfile\",\"\/home\/*\/.gvfs\",\"\/var\/lib\/dhcpcd\/*\"} \/ \"&lt;backup_destination&gt;\"<\/code><\/pre>\n\n\n\n<p>\ud83d\udcdd <strong>Note<\/strong>: you can save the log file in <code>\/var\/log<\/code>.<\/p>\n\n\n\n<p>here,<\/p>\n\n\n\n<p><code>&lt;backup_destination&gt;<\/code>: location where you want your backups to be saved. I will recommend you use a separate drive. Ex &#8211; <code>\/mnt\/crucial<\/code><br><code>--delete<\/code>: means files deleted on the source (in above command, it is <code>\/<\/code>) are to be deleted in the destination as well.<br><code>--verbose<\/code>: verbose output.<br><code>--archive<\/code>: copy all directories recursively; preserve almost everything (ex &#8211; permissions, symlinks, times, etc.) related to files.<br><code>--acls<\/code>: preserve ACLs.<br><code>--xattrs<\/code>: preserve eXtended attributes of a file.<br><code>--partial<\/code>: by default, rsync deletes partially transferred files, but this option says not to delete but instead transfer the remaining part.<br><code>--hard-links<\/code>: preserve hard links but uses more memory.<br><code>--exclude={\"\/dev\/*\",\"\/proc\/*\",\"...}<\/code>: becomes <code>--exclude=\"\/dev\/*\" --exclude=\"\/proc\/*\" ...<\/code>. This is only available in bash and zsh shells. It is used to exclude everything in the given directories. But the directories themselves are created. You can exclude other directories as well such as <code>\"\/home\/ajay\/.cache\/*\"<\/code><br><code>--sparse<\/code>: handles any sparse files, such as virtual disks, Docker images, and similar efficiently.<br><code>--numeric-ids<\/code>: rsync transfers numeric ids of users and groups instead of usernames and group names.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how_to_restore_your_linux_computer_using_rsync\">How to restore your Linux computer using Rsync<\/h2>\n\n\n\n<p>To restore your Computer from the backup you just created, use the same rsync backup command but with the source and destination interchanged. But be careful with <code>\/<\/code> after a directory name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"steps_to_restore_your_computer\">Steps to restore your computer:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/smarttech101.com\/how-to-install-arch-linux-and-support-graphics\/#1-2-create-bootable-drive-using-gui-utilities\" target=\"_blank\" rel=\"noreferrer noopener\">Create a Live Boot Media<\/a>.<\/li>\n\n\n\n<li>Boot into the Live USB.<\/li>\n\n\n\n<li><a href=\"https:\/\/smarttech101.com\/how-to-mount-a-drive-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mount<\/a> all drives in your Computer using commands <code>lsblk<\/code> and <code>mount &lt;source&gt; &lt;destination&gt;<\/code><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>mount \/dev\/\"$from\" \/mnt\/fromdir\nmount \/dev\/\"$to\" \/mnt\/todir<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>Now, execute the following rsync command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync --archive --acls --xattrs --hard-links --verbose --log-file=\/rsync.log --delete --exclude={\"\/dev\/*\",\"\/proc\/*\",\"\/sys\/*\",\"\/tmp\/*\",\"\/run\/*\",\"\/mnt\/*\",\"\/media\/*\",\"\/lost+found\",\"\/swapfile\",\"\/home\/*\/.gvfs\",\"\/var\/lib\/dhcpcd\/*\"}  \/mnt\/fromdir\/&lt;location_of_your_backup&gt;\/ \/mnt\/todir<\/code><\/pre>\n\n\n\n<p>here, <code>&lt;location_of_your_backup&gt;<\/code> is your backup location in the backup drive. For example, if you are backing up your computer on a hard disk. The hard disk has many folders. One is <code>PC_backup<\/code> folder used to backup your PC. Then the <code>&lt;location_of_your_backup&gt;<\/code> will be <code>PC_backup<\/code>.<\/p>\n\n\n\n<p>That&#8217;s all.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating_script_for_backup_and_restore_using_rsync_in_linux\">Creating script for backup and restore using rsync in Linux<\/h2>\n\n\n\n<p>Learn here about&nbsp;<a href=\"https:\/\/smarttech101.com\/how-to-create-shell-scripts-in-linux-unix\/\" target=\"_blank\" rel=\"noreferrer noopener\">what is a shell script and how to create one.<\/a><\/p>\n\n\n\n<p>The following is the script I use. I have restored my PC twice using this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\nset -o errexit # exit on error\nset -o pipefail # fail the pipe if any of its command fails\nset -o nounset # if any variable is undefined exit\n\nbackup(){\n\nbackup_destination=\"\/mnt\/VHD\"\n\n# `SOURCE\/ means` only SOURCE's content will be transferred.\n# `DESTINATION\/ and DESTINATION` both are same for rsync\nsudo rsync --archive --acls --xattrs --hard-links --verbose --log-file=\/rsync.log --delete --exclude={\"\/dev\/*\",\"\/proc\/*\",\"\/sys\/*\",\"\/tmp\/*\",\"\/run\/*\",\"\/mnt\/*\",\"\/media\/*\",\"\/lost+found\",\"\/swapfile\",\"\/home\/*\/.gvfs\",\"\/var\/lib\/dhcpcd\/*\",\"\/Anki2\/*\",\"\/home\/ajay\/.cache\/*\"} \/ \"$backup_destination\"\n\n}\n\n# no need to use sudo because most of the time you will be executing it as root\nrestore(){\n\n# users will answer the upcoming questions based on lsblk's output\nlsblk\n\necho -e \"where do you want to restore from? (ex- sda1, nvme1n1p1,) \"\nread -r from\necho -e \"your backup location in the above source with no trailing forward slash? (ex- backup, and backup\/archlinux) \"\nread -r location\necho -e \"where do you want to restore to? (ex- sdb1) \"\nread -r to\n\n# make directories otherwise error\nmkdir \/mnt\/fromdir\nmkdir \/mnt\/todir\n\n# umount in case you have mounted the source\/destination at somewhere else.\numount --lazy \/dev\/\"$from\" || :\numount --lazy \/dev\/\"$to\" || :\n\n# mounting the source and destination\nmount \/dev\/\"$from\" \/mnt\/fromdir\nmount \/dev\/\"$to\" \/mnt\/todir\n\nrsync --archive --acls --xattrs --hard-links --verbose --log-file=\/rsync.log --delete --exclude={\"\/dev\/*\",\"\/proc\/*\",\"\/sys\/*\",\"\/tmp\/*\",\"\/run\/*\",\"\/mnt\/*\",\"\/media\/*\",\"\/lost+found\",\"\/swapfile\",\"\/home\/*\/.gvfs\",\"\/var\/lib\/dhcpcd\/*\",\"\/Anki2\/*\",\"\/home\/ajay\/.cache\/*\"}  \/mnt\/fromdir\/\"$location\"\/ \/mnt\/todir\n\numount --lazy \/mnt\/\"$from\"\numount --lazy \/mnt\/\"$to\"\n\n}\n\n\nhelp_page(){\n\ncat &lt;&lt; document\n-b &#91;b]ackup\n-r &#91;r]estore\ndocument\n\n}\n\n\nmain(){\n\n  case \"$1\" in\n    \"-b\") backup ;;\n    \"-r\") restore ;;\n    \"-h\") help_page ;;\n    *)    help_page &amp;&amp; exit 1 ;;\n  esac\n\n}\n\n\nmain \"$1\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating_a_cronanacron_job_for_periodic_backup_using_rsync\">Creating a cron\/anacron job for periodic backup using rsync<\/h2>\n\n\n\n<p>If you don&#8217;t know how cron works, look at my article <a href=\"https:\/\/smarttech101.com\/cron-the-job-scheduler-in-linux-unix\/\" target=\"_blank\" rel=\"noreferrer noopener\">cronjob in Linux<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"rsync_backup_using_crontab_e\">Rsync backup using crontab -e<\/h3>\n\n\n\n<p>To backup using cron, execute the command <code>sudo EDITOR=nvim crontab -e<\/code>.<br>Append a line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>30 23 * * TUE,FRI \/path\/to\/rsync.sh -b<\/code><\/pre>\n\n\n\n<p>This will backup your computer at 23:30 on Tuesday and Friday. Change the day and time if you wish.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"rsync_backup_using_etccrontab\">Rsync backup using \/etc\/crontab<\/h3>\n\n\n\n<p>The same can be done using <code>\/etc\/crontab<\/code> as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>30 23 * * TUE,FRI root \/path\/to\/rsync.sh -b<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"rsync_backup_using_anacrontab\">Rsync backup using anacrontab<\/h3>\n\n\n\n<p>Using <a href=\"https:\/\/smarttech101.com\/how-to-use-anacron-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">anacron<\/a> is the <strong>best method<\/strong> since it does not lose the backup in case your computer is shut down when the backup is scheduled.<\/p>\n\n\n\n<p>For this append the following line in the <code>\/etc\/anacrontab<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>3  0  backup \/path\/to\/rsync.sh -b<\/code><\/pre>\n\n\n\n<p>This will backup your computer every third day.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>That was all. The same method can be used to backup and restore any directory as well. You can modify the script by <a href=\"https:\/\/smarttech101.com\/how-to-send-notifications-in-linux-using-dunstify-notify-send\/\" target=\"_blank\" rel=\"noreferrer noopener\">adding a notification using dunstify\/notify-send<\/a> or email command in case the backup is interrupted (using the <code>trap<\/code> command). Use the comment section if you have any questions\/suggestions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.<\/p>\n","protected":false},"author":2,"featured_media":2510,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17],"tags":[18],"class_list":["post-2481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line-tools","tag-command-line-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Backup and Restore Your Computer Using Rsync | SmartTech101<\/title>\n<meta name=\"description\" content=\"Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Backup and Restore Your Computer Using Rsync | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-17T19:04:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-17T09:32:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"Backup and Restore Your Computer Using Rsync\",\"datePublished\":\"2023-03-17T19:04:04+00:00\",\"dateModified\":\"2023-08-17T09:32:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\"},\"wordCount\":685,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1\",\"keywords\":[\"Command Line Tools\"],\"articleSection\":[\"Command Line Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\",\"url\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\",\"name\":\"Backup and Restore Your Computer Using Rsync | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1\",\"datePublished\":\"2023-03-17T19:04:04+00:00\",\"dateModified\":\"2023-08-17T09:32:21+00:00\",\"description\":\"Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720,\"caption\":\"Backup and Restore Your Computer Using Rsync\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backup and Restore Your Computer Using Rsync\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Backup and Restore Your Computer Using Rsync | SmartTech101","description":"Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/","og_locale":"en_US","og_type":"article","og_title":"Backup and Restore Your Computer Using Rsync | SmartTech101","og_description":"Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.","og_url":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/","og_site_name":"SmartTech101","article_published_time":"2023-03-17T19:04:04+00:00","article_modified_time":"2023-08-17T09:32:21+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png","type":"image\/png"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"Backup and Restore Your Computer Using Rsync","datePublished":"2023-03-17T19:04:04+00:00","dateModified":"2023-08-17T09:32:21+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/"},"wordCount":685,"commentCount":1,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1","keywords":["Command Line Tools"],"articleSection":["Command Line Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/","url":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/","name":"Backup and Restore Your Computer Using Rsync | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1","datePublished":"2023-03-17T19:04:04+00:00","dateModified":"2023-08-17T09:32:21+00:00","description":"Here, I will talk about how to use rsync for backup and restore. Then I will guide you how to create a script and cronjob for that.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1","width":1280,"height":720,"caption":"Backup and Restore Your Computer Using Rsync"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/backup-and-restore-your-computer-using-rsync\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"Backup and Restore Your Computer Using Rsync"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2023\/03\/Backup-and-Restore-Your-Computer-Using-Rsync.png?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2481"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=2481"}],"version-history":[{"count":5,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2481\/revisions"}],"predecessor-version":[{"id":3031,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2481\/revisions\/3031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/2510"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=2481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=2481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=2481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}