{"id":620,"date":"2026-07-18T04:41:00","date_gmt":"2026-07-18T04:41:00","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=620"},"modified":"2026-08-05T22:18:12","modified_gmt":"2026-08-05T22:18:12","slug":"vps-backup-automation-rsync-restic-rclone","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/","title":{"rendered":"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A misconfigured cron job or an accidental <code>rm -rf<\/code> can erase months of work in seconds, and provider-level storage failures, while rare, do happen. The 3-2-1 rule \u2014 three copies of your data, on two different media types, with one copy offsite \u2014 exists for exactly this reason, and on a VPS it is fully automatable with three complementary tools: <strong>rsync<\/strong> for continuous file-level sync, <strong>restic<\/strong> for encrypted, deduplicated snapshots, and <strong>rclone<\/strong> for offsite copies to object storage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Storage sizing comes before the pipeline: a snapshot repository needs headroom above your live data, and offsite copies consume their own quota. If you are still choosing the server, <a href=\"https:\/\/virtualserversvps.com\/#providers\">see the full specs on our VPS comparison table<\/a> and pick a plan with at least double your dataset size in disk.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Tools and What Each One Does<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Tool<\/th><th>Job<\/th><th>Key property<\/th><\/tr><\/thead><tbody><tr><td>rsync<\/td><td>File-level sync over SSH<\/td><td>Incremental delta transfers<\/td><\/tr><tr><td>restic<\/td><td>Point-in-time snapshots<\/td><td>Encrypted, deduplicated, append-only<\/td><\/tr><tr><td>rclone<\/td><td>Offsite cloud copies<\/td><td>40+ backends: S3, B2, GCS, Drive<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each tool fills one slot in the pipeline. rsync mirrors directories; restic stores encrypted snapshots you can restore to any moment in time; rclone syncs the snapshot repository to cheap object storage so a total VPS loss still leaves you with a recoverable copy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pipeline is deliberately layered rather than redundant: rsync gives you a current, browseable copy, restic gives you history with encryption at rest, and rclone gives you geographic separation. If any single layer fails \u2014 a dead backup disk, a corrupted repository, a full cloud bucket \u2014 the other two still cover you. That layering is what turns a backup script into a backup strategy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before automating anything, decide what actually needs backing up. Web roots, upload directories, database dumps, and <code>\/etc<\/code> configuration are the obvious candidates; package caches, session files, and build artifacts are not. If deleting it costs you more than an hour to rebuild, it belongs in the pipeline \u2014 that list becomes the <code>--exclude<\/code>\/<code>--include<\/code> rules you maintain for years.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation on Ubuntu 24.04<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update && apt install -y rsync restic rclone\nrestic self-update || true\nrclone version   # confirm all three are present<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">All three tools live in the default Ubuntu repositories, so installation is a single command. restic also ships a self-update helper that keeps the binary current between OS releases.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">rsync: Daily File-Level Sync<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -avz --delete \/var\/www\/ backup@remote:\/backups\/www\/ \\\n  --exclude cache\/ --exclude tmp\/<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><code>-a<\/code> preserves permissions, ownership, and timestamps; <code>-vz<\/code> gives progress and compression.<\/li><li><code>--delete<\/code> mirrors deletions so the copy never drifts from the source.<\/li><li><code>--exclude<\/code> keeps caches and temp files out of the backup, cutting both time and bandwidth.<\/li><li>Run it over SSH with key-based auth \u2014 never a password, or cron will fail silently.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">restic: Encrypted, Deduplicated Snapshots<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>export RESTIC_REPOSITORY=\/backups\/restic\nexport RESTIC_PASSWORD=\"$(cat \/root\/.restic-pass)\"\nrestic init\nrestic backup \/var\/www \/etc \/var\/lib\/mysql --exclude \/var\/www\/cache\nrestic forget --keep-daily 7 --keep-weekly 4 --prune<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">restic splits files into chunks and stores each chunk once, so a 10 GB site with daily changes of a few MB keeps the repository small. The repository is encrypted with your passphrase \u2014 store it in a password manager, because without it the snapshots are unrecoverable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>forget --prune<\/code> step stops the repository growing without bound: <code>forget<\/code> marks old snapshots for removal per your retention policy, and <code>--prune<\/code> reclaims the space. Without pruning, a busy site can balloon to several times its live size and quietly fill the VPS disk. Run <code>restic snapshots<\/code> periodically to confirm the retention policy \u2014 seven daily, four weekly snapshots is a sane default for most production sites.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">rclone: Offsite Copies to Object Storage<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>rclone config          # interactive: pick S3, B2, GCS, or Drive\nrclone sync \/backups\/restic offsite:vps-backups\/ --checksum<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Point rclone at the restic repository rather than the raw files: you replicate one encrypted, deduplicated blob instead of thousands of loose files, and the offsite copy stays consistent with the snapshot index.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">One Cron Schedule to Rule Them All<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>30 2 * * * rsync -avz --delete \/var\/www\/ backup@remote:\/backups\/www\/\n15 3 * * * \/usr\/local\/bin\/restic-backup.sh\n45 4 * * * rclone sync \/backups\/restic offsite:vps-backups\/ --checksum\n0  6 * * 0 restic forget --keep-daily 7 --keep-weekly 4 --prune<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Stagger the jobs so rsync finishes before restic snapshots the directories, and restic finishes before rclone replicates. Redirect output to a log and add <code>MAILTO<\/code> or a webhook so failures are visible, not silent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Write the restic job as a small script instead of a one-liner so you can add error handling: <code>set -euo pipefail<\/code>, capture the exit code, and exit non-zero on failure so cron&#8217;s <code>MAILTO<\/code> fires. A backup that silently fails for three weeks is worse than no backup \u2014 you only discover it at the worst possible moment.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Keep the backup logs in a dedicated file (<code>\/var\/log\/backup.log<\/code>) with timestamps, and rotate them with logrotate so they do not grow forever.<\/li><li>Add a simple health check: have the cron job write a timestamp file, and monitor its age \u2014 if it stops updating, something is broken.<\/li><li>Test the restore procedure on a throwaway VPS, not the production box, so a mistake during testing cannot hurt live data.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Testing Restores Is the Real Backup<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Run <code>restic restore latest --target \/tmp\/restore-test<\/code> once a month and diff a few files against production.<\/li><li>Test rsync with <code>--dry-run<\/code> to confirm the remote tree matches expectations.<\/li><li>Verify the offsite copy with <code>rclone check offsite:vps-backups\/<\/code> \u2014 checksums, not just existence.<\/li><li>Document your recovery time objective so you know how long a full restore is allowed to take.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Whatever toolchain you pick, schedule a restore test at least monthly \u2014 an untested backup is a guess, not a guarantee. If you are provisioning a second VPS purely as a backup target, <a href=\"https:\/\/virtualserversvps.com\/#providers\">compare plans side by side on our comparison table<\/a> to find one with the disk and bandwidth this pipeline needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">InterServer&#8217;s VPS plans include generous storage and unmetered bandwidth, which makes them a practical choice for an offsite backup node. Check <a href=\"https:\/\/interserver.net\/vps?id=1067805&amp;sid=virtualserversvps\" rel=\"noreferrer noopener sponsored\" target=\"_blank\">InterServer VPS plans and pricing<\/a> before you commit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A misconfigured cron job or an accidental rm -rf can erase months of work in seconds, and provider-level storage failures, while rare, do happen. The 3-2-1 rule \u2014 three copies&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","hentry","category-vps-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies - Virtual Servers VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies\" \/>\n<meta property=\"og:description\" content=\"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-18T04:41:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-05T22:18:12+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/\",\"name\":\"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-07-18T04:41:00+00:00\",\"dateModified\":\"2026-08-05T22:18:12+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies - Virtual Servers VPS Blog","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:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/","og_locale":"en_US","og_type":"article","og_title":"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies","og_description":"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies","og_url":"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-07-18T04:41:00+00:00","article_modified_time":"2026-08-05T22:18:12+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/","url":"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/","name":"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-07-18T04:41:00+00:00","dateModified":"2026-08-05T22:18:12+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/vps-backup-automation-rsync-restic-rclone\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VPS Backup Automation with rsync, restic, and rclone: Cron Jobs, Snapshots, and Offsite Copies"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":2,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"predecessor-version":[{"id":803,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/620\/revisions\/803"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}