[{"data":1,"prerenderedAt":39},["ShallowReactive",2],{"article-building-a-rock-solid-home-server-backup-strategy-my-3-2-1-approach-bd7":3},{"type_of":4,"id":5,"title":6,"description":7,"readable_publish_date":8,"slug":9,"path":10,"url":11,"comments_count":12,"public_reactions_count":13,"collection_id":14,"published_timestamp":15,"language":16,"subforem_id":17,"positive_reactions_count":13,"cover_image":18,"social_image":19,"canonical_url":11,"created_at":15,"edited_at":20,"crossposted_at":14,"published_at":15,"last_comment_at":15,"reading_time_minutes":21,"tag_list":22,"tags":23,"body_html":28,"body_markdown":29,"user":30},"article",2754118,"Building a Rock-Solid Home Server Backup Strategy - My 3-2-1 Approach","When you’re running a home server that stores your personal files, photos, media, and even services...","Aug 5 '25","building-a-rock-solid-home-server-backup-strategy-my-3-2-1-approach-bd7","\u002Fashraful\u002Fbuilding-a-rock-solid-home-server-backup-strategy-my-3-2-1-approach-bd7","https:\u002F\u002Fdev.to\u002Fashraful\u002Fbuilding-a-rock-solid-home-server-backup-strategy-my-3-2-1-approach-bd7",0,2,null,"2025-08-05T17:24:55Z","en",1,"https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=1000,height=420,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcrw738bpvpu97j8gbtf.png","https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=1000,height=500,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcrw738bpvpu97j8gbtf.png","2025-08-05T17:26:33Z",3,"backup, server, ubuntu, devops",[24,25,26,27],"backup","server","ubuntu","devops","\u003Cp>When you’re running a home server that stores your personal files, photos, media, and even services like Pi-hole or Jellyfin, \u003Cstrong>a proper backup strategy isn’t optional—it’s essential\u003C\u002Fstrong>. Data loss can happen due to hardware failure, accidental deletion, or even corruption. That’s why I follow a proven and practical method known as the \u003Cstrong>3-2-1 backup strategy\u003C\u002Fstrong>.\u003C\u002Fp>\n\n\u003Cp>In this blog post, I’ll walk you through how I’ve implemented this strategy using a combination of \u003Cstrong>external SSD storage\u003C\u002Fstrong> and \u003Cstrong>network-based backups over SSH\u003C\u002Fstrong>.\u003C\u002Fp>\n\n\u003Cp>\u003Cstrong>Originally Posted on \u003Ca href=\"https:\u002F\u002Fblog.ashraful.dev\u002Fseries\u002Fhome-server\u002F3-321-backup-strategy-of-home-server.html\" target=\"_blank\" rel=\"noopener noreferrer\">Ashraful's Blog\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>\n\n\n\u003Chr>\n\n\u003Ch2>\n  \u003Ca name=\"what-is-the-321-backup-strategy\" href=\"#what-is-the-321-backup-strategy\">\n  \u003C\u002Fa>\n  What is the 3-2-1 Backup Strategy?\n\u003C\u002Fh2>\n\n\u003Cp>The 3-2-1 rule is a simple yet powerful backup principle:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>\n\u003Cstrong>3\u003C\u002Fstrong> copies of your data (1 primary + 2 backups)\u003C\u002Fli>\n\u003Cli>\n\u003Cstrong>2\u003C\u002Fstrong> different types of media (e.g., SSD, HDD, cloud, etc.)\u003C\u002Fli>\n\u003Cli>\n\u003Cstrong>1\u003C\u002Fstrong> copy stored offsite\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>This strategy reduces the risk of total data loss by spreading your backups across multiple locations and types of storage.\u003C\u002Fp>\n\n\n\u003Chr>\n\n\u003Ch2>\n  \u003Ca name=\"1-primary-storage-my-home-server\" href=\"#1-primary-storage-my-home-server\">\n  \u003C\u002Fa>\n  1. Primary Storage: My Home Server\n\u003C\u002Fh2>\n\n\u003Cp>My home server is the heart of my digital setup. It hosts:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>A media server (Jellyfin)\u003C\u002Fli>\n\u003Cli>Personal files and documents\u003C\u002Fli>\n\u003Cli>Photos and videos (via Immich)\u003C\u002Fli>\n\u003Cli>Various self-hosted services (like Pi-hole, Portainer, etc.)\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>This is where the \u003Cstrong>primary copy\u003C\u002Fstrong> of all my data lives.\u003C\u002Fp>\n\n\n\u003Chr>\n\n\u003Ch2>\n  \u003Ca name=\"2-local-backup-external-ssd-with-rsync-script\" href=\"#2-local-backup-external-ssd-with-rsync-script\">\n  \u003C\u002Fa>\n  2. Local Backup: External SSD with Rsync Script\n\u003C\u002Fh2>\n\n\u003Cp>To maintain a local backup, I’ve connected an \u003Cstrong>external SSD\u003C\u002Fstrong> directly to my home server.\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>The SSD is mounted and automatically recognized on boot.\u003C\u002Fli>\n\u003Cli>I back up \u003Cstrong>everything important\u003C\u002Fstrong> to this drive using a Bash script powered by \u003Ccode>rsync\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>A cron job or systemd timer can automate the execution of this script regularly.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>Here’s a sample of the SSD backup script:\u003Cbr>\n\u003C\u002Fp>\n\n\u003Cdiv class=\"highlight js-code-highlight\">\n\u003Cpre class=\"highlight shell\">\u003Ccode>\u003Cspan class=\"c\">#!\u002Fbin\u002Fbash\u003C\u002Fspan>\n\n\u003Cspan class=\"nv\">SOURCE\u003C\u002Fspan>\u003Cspan class=\"o\">=\u003C\u002Fspan>\u003Cspan class=\"s2\">\"\u002Fdata\"\u003C\u002Fspan>\n\u003Cspan class=\"nv\">DEST\u003C\u002Fspan>\u003Cspan class=\"o\">=\u003C\u002Fspan>\u003Cspan class=\"s2\">\"\u002Fmnt\u002Fbackup_ssd\"\u003C\u002Fspan>\n\n\u003Cspan class=\"nb\">echo\u003C\u002Fspan> \u003Cspan class=\"s2\">\"Starting backup to external SSD...\"\u003C\u002Fspan>\n\u003Cspan class=\"nb\">mkdir\u003C\u002Fspan> \u003Cspan class=\"nt\">-p\u003C\u002Fspan> \u003Cspan class=\"s2\">\"\u003C\u002Fspan>\u003Cspan class=\"nv\">$DEST\u003C\u002Fspan>\u003Cspan class=\"s2\">\"\u003C\u002Fspan>\nrsync \u003Cspan class=\"nt\">-azP\u003C\u002Fspan> \u003Cspan class=\"nt\">--delete\u003C\u002Fspan> \u003Cspan class=\"s2\">\"\u003C\u002Fspan>\u003Cspan class=\"nv\">$SOURCE\u003C\u002Fspan>\u003Cspan class=\"s2\">\u002F\"\u003C\u002Fspan> \u003Cspan class=\"s2\">\"\u003C\u002Fspan>\u003Cspan class=\"nv\">$DEST\u003C\u002Fspan>\u003Cspan class=\"s2\">\u002F\"\u003C\u002Fspan>\n\u003Cspan class=\"nb\">echo\u003C\u002Fspan> \u003Cspan class=\"s2\">\"Backup to SSD completed.\"\u003C\u002Fspan>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cdiv class=\"highlight__panel js-actions-panel\">\n\u003Cdiv class=\"highlight__panel-action js-fullscreen-code-action\">\n    \u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\">\u003Ctitle>Enter fullscreen mode\u003C\u002Ftitle>\n    \u003Cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\">\u003C\u002Fpath>\n\u003C\u002Fsvg>\n\n    \u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\">\u003Ctitle>Exit fullscreen mode\u003C\u002Ftitle>\n    \u003Cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\">\u003C\u002Fpath>\n\u003C\u002Fsvg>\n\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n\n\n\u003Cp>\u003Cstrong>Here is the actual script of mine. \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fiashraful\u002Fbackup-on-disk\" target=\"_blank\" rel=\"noopener noreferrer\">Github Repo\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>\n\n\u003Cp>This makes sure the SSD always has the latest version of my data and also removes deleted files for consistency.\u003C\u002Fp>\n\n\n\u003Chr>\n\n\u003Ch2>\n  \u003Ca name=\"3-network-backup-remote-sync-over-ssh-with-variables\" href=\"#3-network-backup-remote-sync-over-ssh-with-variables\">\n  \u003C\u002Fa>\n  3. Network Backup: Remote Sync Over SSH with Variables\n\u003C\u002Fh2>\n\n\u003Cp>To fulfill the \u003Cstrong>offsite\u003C\u002Fstrong> part of the 3-2-1 strategy, I’ve also implemented a \u003Cstrong>remote backup over my local network\u003C\u002Fstrong>.\u003C\u002Fp>\n\n\u003Cp>Here’s how it works:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>I use a custom Bash script that uses \u003Ccode>rsync\u003C\u002Fcode> over SSH.\u003C\u002Fli>\n\u003Cli>It pulls variables like source, destination, remote user, and host from the script, making it easy to reuse or tweak.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>Here’s a sample of the SSH-based backup script:\u003Cbr>\n\u003C\u002Fp>\n\n\u003Cdiv class=\"highlight js-code-highlight\">\n\u003Cpre class=\"highlight shell\">\u003Ccode>\u003Cspan class=\"c\">#!\u002Fbin\u002Fbash\u003C\u002Fspan>\n\n\u003Cspan class=\"nv\">SOURCE\u003C\u002Fspan>\u003Cspan class=\"o\">=\u003C\u002Fspan>\u003Cspan class=\"s2\">\"\u002Fdata\"\u003C\u002Fspan>\n\u003Cspan class=\"nv\">REMOTE_USER\u003C\u002Fspan>\u003Cspan class=\"o\">=\u003C\u002Fspan>\u003Cspan class=\"s2\">\"user\"\u003C\u002Fspan>\n\u003Cspan class=\"nv\">REMOTE_HOST\u003C\u002Fspan>\u003Cspan class=\"o\">=\u003C\u002Fspan>\u003Cspan class=\"s2\">\"192.168.1.10\"\u003C\u002Fspan>\n\u003Cspan class=\"nv\">REMOTE_PATH\u003C\u002Fspan>\u003Cspan class=\"o\">=\u003C\u002Fspan>\u003Cspan class=\"s2\">\"\u002Fmnt\u002Fbackup\u002Fdata\"\u003C\u002Fspan>\n\n\u003Cspan class=\"nb\">echo\u003C\u002Fspan> \u003Cspan class=\"s2\">\"Starting remote network backup...\"\u003C\u002Fspan>\nrsync \u003Cspan class=\"nt\">-azP\u003C\u002Fspan> \u003Cspan class=\"nt\">-e\u003C\u002Fspan> ssh \u003Cspan class=\"s2\">\"\u003C\u002Fspan>\u003Cspan class=\"nv\">$SOURCE\u003C\u002Fspan>\u003Cspan class=\"s2\">\u002F\"\u003C\u002Fspan> \u003Cspan class=\"s2\">\"\u003C\u002Fspan>\u003Cspan class=\"nv\">$REMOTE_USER\u003C\u002Fspan>\u003Cspan class=\"s2\">@\u003C\u002Fspan>\u003Cspan class=\"nv\">$REMOTE_HOST\u003C\u002Fspan>\u003Cspan class=\"s2\">:\u003C\u002Fspan>\u003Cspan class=\"nv\">$REMOTE_PATH\u003C\u002Fspan>\u003Cspan class=\"s2\">\"\u003C\u002Fspan>\n\u003Cspan class=\"nb\">echo\u003C\u002Fspan> \u003Cspan class=\"s2\">\"Remote backup completed.\"\u003C\u002Fspan>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cdiv class=\"highlight__panel js-actions-panel\">\n\u003Cdiv class=\"highlight__panel-action js-fullscreen-code-action\">\n    \u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\">\u003Ctitle>Enter fullscreen mode\u003C\u002Ftitle>\n    \u003Cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\">\u003C\u002Fpath>\n\u003C\u002Fsvg>\n\n    \u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\">\u003Ctitle>Exit fullscreen mode\u003C\u002Ftitle>\n    \u003Cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\">\u003C\u002Fpath>\n\u003C\u002Fsvg>\n\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n\n\n\u003Cp>This ensures I’m keeping a secondary backup in a different physical location, even if it's just across the network.\u003C\u002Fp>\n\n\n\u003Chr>\n\n\u003Ch2>\n  \u003Ca name=\"why-this-setup-works-for-me\" href=\"#why-this-setup-works-for-me\">\n  \u003C\u002Fa>\n  Why This Setup Works for Me\n\u003C\u002Fh2>\n\n\u003Cul>\n\u003Cli>\n\u003Cstrong>Redundancy\u003C\u002Fstrong>: With multiple local and remote backups, I have peace of mind even if one disk fails.\u003C\u002Fli>\n\u003Cli>\n\u003Cstrong>Speed\u003C\u002Fstrong>: The SSD makes for quick restores, while SSH syncs avoid re-copying everything unnecessarily.\u003C\u002Fli>\n\u003Cli>\n\u003Cstrong>Privacy\u003C\u002Fstrong>: Everything stays in my own network—no cloud involved.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\n\u003Chr>\n\n\u003Ch2>\n  \u003Ca name=\"final-thoughts\" href=\"#final-thoughts\">\n  \u003C\u002Fa>\n  Final Thoughts\n\u003C\u002Fh2>\n\n\u003Cp>Implementing a backup strategy might seem tedious at first, but trust me—it’s worth every bit of effort. Data loss can be painful and costly, especially when it comes to irreplaceable personal content.\u003C\u002Fp>\n\n\u003Cp>By following the \u003Cstrong>3-2-1 strategy\u003C\u002Fstrong> and using a mix of \u003Cstrong>external SSDs\u003C\u002Fstrong> and \u003Cstrong>network-based backups\u003C\u002Fstrong>, I’ve built a system that’s simple, reliable, and tailored to my setup. If you’re running a home server, I highly recommend investing time in your own backup plan—your future self will thank you.\u003C\u002Fp>\n\n","\nWhen you’re running a home server that stores your personal files, photos, media, and even services like Pi-hole or Jellyfin, **a proper backup strategy isn’t optional—it’s essential**. Data loss can happen due to hardware failure, accidental deletion, or even corruption. That’s why I follow a proven and practical method known as the **3-2-1 backup strategy**.\n\nIn this blog post, I’ll walk you through how I’ve implemented this strategy using a combination of **external SSD storage** and **network-based backups over SSH**.\n\n\n**Originally Posted on [Ashraful's Blog](https:\u002F\u002Fblog.ashraful.dev\u002Fseries\u002Fhome-server\u002F3-321-backup-strategy-of-home-server.html)**\n\n---\n\n## What is the 3-2-1 Backup Strategy?\n\nThe 3-2-1 rule is a simple yet powerful backup principle:\n\n- **3** copies of your data (1 primary + 2 backups)\n- **2** different types of media (e.g., SSD, HDD, cloud, etc.)\n- **1** copy stored offsite\n\nThis strategy reduces the risk of total data loss by spreading your backups across multiple locations and types of storage.\n\n---\n\n## 1. Primary Storage: My Home Server\n\nMy home server is the heart of my digital setup. It hosts:\n\n- A media server (Jellyfin)\n- Personal files and documents\n- Photos and videos (via Immich)\n- Various self-hosted services (like Pi-hole, Portainer, etc.)\n\nThis is where the **primary copy** of all my data lives.\n\n---\n\n## 2. Local Backup: External SSD with Rsync Script\n\nTo maintain a local backup, I’ve connected an **external SSD** directly to my home server.\n\n- The SSD is mounted and automatically recognized on boot.\n- I back up **everything important** to this drive using a Bash script powered by `rsync`.\n- A cron job or systemd timer can automate the execution of this script regularly.\n\nHere’s a sample of the SSD backup script:\n\n```bash\n#!\u002Fbin\u002Fbash\n\nSOURCE=\"\u002Fdata\"\nDEST=\"\u002Fmnt\u002Fbackup_ssd\"\n\necho \"Starting backup to external SSD...\"\nmkdir -p \"$DEST\"\nrsync -azP --delete \"$SOURCE\u002F\" \"$DEST\u002F\"\necho \"Backup to SSD completed.\"\n```\n\n**Here is the actual script of mine. [Github Repo](https:\u002F\u002Fgithub.com\u002Fiashraful\u002Fbackup-on-disk)**\n\nThis makes sure the SSD always has the latest version of my data and also removes deleted files for consistency.\n\n---\n\n## 3. Network Backup: Remote Sync Over SSH with Variables\n\nTo fulfill the **offsite** part of the 3-2-1 strategy, I’ve also implemented a **remote backup over my local network**.\n\nHere’s how it works:\n\n- I use a custom Bash script that uses `rsync` over SSH.\n- It pulls variables like source, destination, remote user, and host from the script, making it easy to reuse or tweak.\n\nHere’s a sample of the SSH-based backup script:\n\n```bash\n#!\u002Fbin\u002Fbash\n\nSOURCE=\"\u002Fdata\"\nREMOTE_USER=\"user\"\nREMOTE_HOST=\"192.168.1.10\"\nREMOTE_PATH=\"\u002Fmnt\u002Fbackup\u002Fdata\"\n\necho \"Starting remote network backup...\"\nrsync -azP -e ssh \"$SOURCE\u002F\" \"$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH\"\necho \"Remote backup completed.\"\n```\n\nThis ensures I’m keeping a secondary backup in a different physical location, even if it's just across the network.\n\n---\n\n## Why This Setup Works for Me\n\n- **Redundancy**: With multiple local and remote backups, I have peace of mind even if one disk fails.\n- **Speed**: The SSD makes for quick restores, while SSH syncs avoid re-copying everything unnecessarily.\n- **Privacy**: Everything stays in my own network—no cloud involved.\n\n---\n\n## Final Thoughts\n\nImplementing a backup strategy might seem tedious at first, but trust me—it’s worth every bit of effort. Data loss can be painful and costly, especially when it comes to irreplaceable personal content.\n\nBy following the **3-2-1 strategy** and using a mix of **external SSDs** and **network-based backups**, I’ve built a system that’s simple, reliable, and tailored to my setup. If you’re running a home server, I highly recommend investing time in your own backup plan—your future self will thank you.\n",{"name":31,"username":32,"twitter_username":33,"github_username":34,"user_id":35,"website_url":36,"profile_image":37,"profile_image_90":38},"Mohamad Ashraful Islam","ashraful","_ashraful","iashraful",30490,"https:\u002F\u002Fashraful.dev","https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=640,height=640,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F30490%2F9dc1ef64-0233-43b5-9127-79affd83cc43.jpg","https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=90,height=90,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F30490%2F9dc1ef64-0233-43b5-9127-79affd83cc43.jpg",1784633123718]