{"id":4668,"date":"2026-09-21T04:01:06","date_gmt":"2026-09-20T22:31:06","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/enterprise-disaster-recovery-automated-linux-bare-metal-backups-with-borgbackup-and-rclone\/"},"modified":"2026-09-21T04:01:06","modified_gmt":"2026-09-20T22:31:06","slug":"enterprise-disaster-recovery-automated-linux-bare-metal-backups-with-borgbackup-and-rclone","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/enterprise-disaster-recovery-automated-linux-bare-metal-backups-with-borgbackup-and-rclone\/","title":{"rendered":"Enterprise Disaster Recovery: Automated Linux Bare-Metal Backups with BorgBackup and Rclone"},"content":{"rendered":"<p>Enterprise disaster recovery on modern Linux bare-metal and hypervisor nodes is frequently bottlenecked by sluggish tape-era paradigms, excessive storage bloat from full filesystem images, and brittle snapshot mechanisms that crumble during catastrophic hardware replacement. When recovering mission-critical infrastructure deployed on high-performance virtualization stacks or enterprise cloud platforms like <a href=\"https:\/\/cpanelfree.com\">CpanelFree<\/a>, system administrators require deterministic, byte-level deduplication coupled with zero-trust authenticated encryption and resilient offsite transport. By marrying the content-defined chunking and cryptographic integrity of BorgBackup with the cloud-native streaming and multi-backend synchronization capabilities of Rclone, engineering teams can build an automated, fully decoupled bare-metal backup pipeline capable of slashing storage consumption by up to 90% while guaranteeing rapid mean time to recovery (MTTR).<\/p>\n<p><!-- more --><\/p>\n<h2>How to Automate Enterprise Linux Bare-Metal Disaster Recovery with BorgBackup and Rclone<\/h2>\n<div style=\"background:#1e293b;border-left:4px solid #38bdf8;padding:16px 20px;margin:24px 0;border-radius:0 8px 8px 0;color:#e2e8f0\">\n  <strong style=\"color:#38bdf8;display:block;margin-bottom:6px;font-size:16px\">Direct Answer: Enterprise Linux Bare-Metal Backup Architecture<\/strong><br \/>\n  To automate Linux bare-metal disaster recovery, combine BorgBackup&#8217;s client-side chunk-level deduplication and authenticated encryption with Rclone&#8217;s cloud object storage synchronization. Borg captures atomic filesystem states, package lists, and bootloader metadata into encrypted local archives, while Rclone pushes deduplicated repository segments to immutable offsite S3\/B2 storage under systemd automation.\n<\/div>\n<p>Traditional image-based backups (such as raw <code>dd<\/code> dumps or block-level snapshots) preserve the exact disk geometry but force backup windows to span hours, capturing gigabytes of unallocated space and swap churn. Conversely, standard file-level rsync utilities lack native encryption, version history pruning, and block-level deduplication across multiple backup generations. A production-grade bare-metal backup strategy must decouple the high-speed local snapshot generation phase from the outbound network transport phase, ensuring that system resource consumption remains bounded and independent of cloud API latencies.<\/p>\n<h3>The Two-Tier Decoupled Architecture<\/h3>\n<p>The architecture consists of two synchronized, isolated tiers operating under strict systemd scheduling:<\/p>\n<ul>\n<li><strong>Tier 1: Atomic Local Snapshotting (BorgBackup):<\/strong> Captures filesystem state, POSIX ACLs, extended attributes (xattr), SELinux security contexts, and hardware partition metadata into a local, encrypted repository located on an isolated NVMe staging partition or dedicated secondary drive. Content-defined chunking dynamically slices files into variable-sized chunks (typically 512 KiB to 8 MiB) using Rabin fingerprints, avoiding redundant storage of unmodified binaries, container layers, or application runtimes.<\/li>\n<li><strong>Tier 2: Asynchronous Cloud Replication (Rclone):<\/strong> Synchronizes the local Borg repository&#8217;s segment files to offsite object storage (AWS S3, Backblaze B2, Cloudflare R2, or Wasabi) using TLS 1.3, multi-threaded chunk uploads, and bandwidth scheduling. Because Borg repositories operate on an append-only segment format (where existing segment files are immutable until compacted), Rclone only transfers newly created segment chunks, drastically curtailing egress overhead.<\/li>\n<\/ul>\n<div style=\"background:#1e293b;border-left:4px solid #38bdf8;padding:16px 20px;margin:24px 0;border-radius:0 8px 8px 0;color:#e2e8f0\">\n  <strong style=\"color:#38bdf8\">Architecture Note:<\/strong> Never run Rclone directly against a live Borg repository that is actively executing a backup transaction or pruning cycle. Always coordinate the execution using sequential systemd unit dependencies or transactional lockfile guards to eliminate the risk of transferring half-written segment files.\n<\/div>\n<h2>Architectural Comparison: Legacy vs. Modern Bare-Metal Pipelines<\/h2>\n<p>The following performance matrix contrasts legacy backup methodologies against a tuned BorgBackup and Rclone bare-metal pipeline across operational parameters in a 500 GB production Linux host running web services, relational databases, and microservices.<\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;background:#1e293b;color:#e2e8f0;font-size:14px;border-radius:8px;overflow:hidden\">\n<thead style=\"background:#0f172a;color:#38bdf8\">\n<tr>\n<th style=\"padding:12px 16px;border-bottom:2px solid #334155;text-align:left\">Feature \/ Metric<\/th>\n<th style=\"padding:12px 16px;border-bottom:2px solid #334155;text-align:left\">Standard \/ Default (Tar \/ Rsync)<\/th>\n<th style=\"padding:12px 16px;border-bottom:2px solid #334155;text-align:left\">Tuned \/ Production (Borg + Rclone)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Deduplication Method<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">File-level or None (Full Duplication)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155;color:#10b981;font-weight:600\">Content-Defined Chunking (Rabin Fingerprint)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Storage Footprint (90 Daily Snapshots)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">4.5 TB to 12.0 TB (Cumulative Bloat)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155;color:#10b981;font-weight:600\">180 GB to 240 GB (85-95% Reduction)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Data-at-Rest Encryption<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Unencrypted or External GPG Wrapper<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155;color:#10b981;font-weight:600\">Authenticated Blake2b + ChaCha20-Poly1305 \/ AES-256-OCB<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Offsite Transport Targets<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">SSH\/SCP to Single Dedicated Server<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155;color:#10b981;font-weight:600\">Multi-Cloud Object Stores (S3, B2, R2, Wasabi, GCS)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Daily Backup Duration<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">45 to 90 minutes (High I\/O thrashing)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155;color:#10b981;font-weight:600\">1.5 to 4 minutes (Fast metadata &amp; chunk cache)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Bare-Metal Recovery Granularity<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155\">Manual archive extraction, permission loss risks<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #334155;color:#10b981;font-weight:600\">FUSE mountable, granular xattr\/ACL preservation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Phase 1: Bare-Metal Metadata Harvesting<\/h2>\n<p>A true bare-metal recovery requires more than just raw files. Without the underlying partition geometry, Logical Volume Manager (LVM) metadata, UUID mappings, and EFI boot records, extracting a backup onto a fresh disk leaves the system unbootable. Before initiating the Borg archive, an automated pre-backup hook captures critical hardware and storage manifests into <code>\/var\/backups\/metal-meta<\/code>.<\/p>\n<p>The automated script captures:<\/p>\n<ol>\n<li><strong>Block Device and Partition Maps:<\/strong> Dumping exact sector alignments using <code>sfdisk -d<\/code> and GUID partition tables (GPT).<\/li>\n<li><strong>Filesystem UUIDs and Mount Topology:<\/strong> Recording <code>blkid<\/code>, <code>lsblk -f<\/code>, and <code>\/etc\/fstab<\/code> snapshots.<\/li>\n<li><strong>LVM &amp; Software RAID Topologies:<\/strong> Exporting volume group configurations using <code>vgcfgbackup<\/code> and software RAID states from <code>\/proc\/mdstat<\/code>.<\/li>\n<li><strong>EFI Boot Manager Entries:<\/strong> Capturing NVRAM boot configuration via <code>efibootmgr -v<\/code>.<\/li>\n<li><strong>Installed Package Manifests:<\/strong> Generating reproducible package selection manifests (e.g., <code>dpkg --get-selections<\/code> or <code>rpm -qa<\/code>) to enable rapid differential audits.<\/li>\n<\/ol>\n<h2>Phase 2: Production Automation Scripts and Exclusions<\/h2>\n<p>Below is the complete, enterprise-grade bare-metal backup script deployed to <code>\/usr\/local\/bin\/baremetal-backup.sh<\/code>. It handles metadata dumping, database locks, Borg archive creation with authenticated encryption, retention pruning, repository verification, and outbound Rclone synchronization with comprehensive logging.<\/p>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\">#!\/usr\/bin\/env bash\n# =============================================================================\n# Script Name: baremetal-backup.sh\n# Description: Production Bare-Metal Backup via BorgBackup and Rclone\n# Enterprise Hardened: POSIX ACLs, xattrs, Hardware Metadata, S3 Sync\n# =============================================================================\n\nset -Eeuo pipefail\ntrap 'echo \"[ERROR] Backup pipeline failed at line $LINENO. Exiting.\" &gt;&amp;2' ERR\n\n# --- Operational Environment Variables ---\nexport BORG_REPO=\"\/var\/backups\/borg-repo\"\nexport BORG_PASSCOMMAND=\"cat \/etc\/borgbackup\/passphrase.key\"\nexport BORG_RELOCATED_REPO_ACCESS_IS_OK=\"no\"\nexport BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=\"no\"\n\nBACKUP_NAME=\"baremetal-$(hostname -s)-$(date +'%Y-%m-%d_%H%M%S')\"\nMETA_DIR=\"\/var\/backups\/metal-meta\"\nEXCLUDE_FILE=\"\/etc\/borgbackup\/excludes.txt\"\nRCLONE_REMOTE=\"b2-encrypted:backup-vault\/$(hostname -s)\"\nLOG_TAG=\"baremetal-backup\"\n\nlogger -t \"$LOG_TAG\" \"Starting bare-metal backup pipeline: ${BACKUP_NAME}\"\n\n# --- Step 1: Harvest Bare-Metal System Metadata ---\nmkdir -p \"$META_DIR\"\nchmod 700 \"$META_DIR\"\n\necho \"[1\/6] Harvesting storage geometry and hardware metadata...\"\nsfdisk -d \/dev\/nvme0n1 &gt; \"$META_DIR\/sfdisk-nvme0n1.dump\" 2&gt;\/dev\/null || true\nlsblk -f &gt; \"$META_DIR\/lsblk-topology.txt\"\nblkid &gt; \"$META_DIR\/blkid-mappings.txt\"\ncp \/etc\/fstab \"$META_DIR\/fstab.bak\"\n\nif command -v vgs &amp;&gt;\/dev\/null; then\n    vgcfgbackup -f \"$META_DIR\/lvm-vg-%s.vgbackup\" 2&gt;\/dev\/null || true\nfi\n\nif [ -d \/sys\/firmware\/efi ]; then\n    efibootmgr -v &gt; \"$META_DIR\/efibootmgr.txt\" 2&gt;\/dev\/null || true\nfi\n\nif command -v dpkg &amp;&gt;\/dev\/null; then\n    dpkg --get-selections &gt; \"$META_DIR\/dpkg-selections.txt\"\nelif command -v rpm &amp;&gt;\/dev\/null; then\n    rpm -qa --qf '%{NAME} %{VERSION}-%{RELEASE}.%{ARCH}\\n' &gt; \"$META_DIR\/rpm-manifest.txt\"\nfi\n\n# --- Step 2: Execute Borg Local Deduplicated Backup ---\necho \"[2\/6] Executing Borg atomic snapshot...\"\nborg create \\\n    --verbose \\\n    --filter AME \\\n    --list \\\n    --stats \\\n    --show-rc \\\n    --compression zstd,6 \\\n    --exclude-caches \\\n    --exclude-from \"$EXCLUDE_FILE\" \\\n    \"$BORG_REPO::$BACKUP_NAME\" \\\n    \/ \\\n    \/boot \\\n    \/boot\/efi \\\n    \/var\n\n# --- Step 3: Prune Stale Snapshots (Grandfather-Father-Son Policy) ---\necho \"[3\/6] Pruning repository per retention policy...\"\nborg prune \\\n    --list \\\n    --show-rc \\\n    --keep-within 2d \\\n    --keep-daily 7 \\\n    --keep-weekly 4 \\\n    --keep-monthly 12 \\\n    --prefix \"baremetal-$(hostname -s)-\" \\\n    \"$BORG_REPO\"\n\n# --- Step 4: Compact Repository to Reclaim Space ---\necho \"[4\/6] Compacting Borg repository segments...\"\nborg compact \"$BORG_REPO\"\n\n# --- Step 5: Sync Local Repository to Cloud Storage via Rclone ---\necho \"[5\/6] Syncing deduplicated repository to offsite object store...\"\nrclone sync \"$BORG_REPO\" \"$RCLONE_REMOTE\" \\\n    --fast-list \\\n    --transfers 8 \\\n    --checkers 16 \\\n    --b2-hard-delete \\\n    --drive-use-trash=false \\\n    --log-level NOTICE \\\n    --stats 30s\n\n# --- Step 6: Log Completion ---\necho \"[6\/6] Bare-metal backup and offsite sync completed successfully.\"\nlogger -t \"$LOG_TAG\" \"Finished bare-metal backup pipeline: ${BACKUP_NAME}\"<\/code><\/pre>\n<h3>Configuring the Exclusion Matrix<\/h3>\n<p>Backing up pseudo-filesystems, transient runtime mounts, and socket descriptors corrupts backup integrity and wastes I\/O bandwidth. Save the following exclusion rules to <code>\/etc\/borgbackup\/excludes.txt<\/code>:<\/p>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\"># \/etc\/borgbackup\/excludes.txt\n# Core Linux pseudo and virtual filesystems\n- \/dev\/*\n- \/proc\/*\n- \/sys\/*\n- \/run\/*\n- \/tmp\/*\n- \/var\/tmp\/*\n- \/var\/run\/*\n- \/lost+found\n\n# Mount points and network filesystems\n- \/mnt\/*\n- \/media\/*\n- \/net\/*\n- \/misc\/*\n\n# Local Borg repository itself to prevent recursive explosion\n- \/var\/backups\/borg-repo\n\n# Ephemeral swap and paging devices\n- \/swapfile\n- *.swap\n\n# Volatile caches and application build directories\n- \/var\/cache\/*\n- \/var\/lib\/docker\/overlay2\/*\n- \/var\/lib\/containerd\/io.containerd.snapshotter.v1.overlayfs\/*\n- \/root\/.cache\/*\n- \/home\/*\/.cache\/*<\/code><\/pre>\n<h2>Phase 3: Systemd Service and Timer Hardening<\/h2>\n<p>Cron lacks process supervision, integrated journal logging, dynamic resource slicing, and dependency sequencing. In production environments, bare-metal backups must be executed by a sandboxed systemd service managed by an automated calendar timer with low I\/O and CPU scheduling priority.<\/p>\n<h3>Systemd Service Unit: <code>\/etc\/systemd\/system\/borg-backup.service<\/code><\/h3>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\">[Unit]\nDescription=Automated Bare-Metal BorgBackup and Rclone Pipeline\nDocumentation=man:borg(1) man:rclone(1)\nAfter=network-online.target local-fs.target\nWants=network-online.target\n\n[Service]\nType=oneshot\nExecStart=\/usr\/local\/bin\/baremetal-backup.sh\nNice=19\nIOSchedulingClass=best-effort\nIOSchedulingPriority=7\nCPUSchedulingPolicy=other\nCPUWeight=100\nIOWeight=100\n\n# Security Hardening Directives\nProtectSystem=strict\nProtectHome=read-only\nReadWritePaths=\/var\/backups \/root\/.cache\/borg \/root\/.config\/rclone\nPrivateTmp=true\nProtectKernelTunables=true\nProtectKernelModules=true\nProtectControlGroups=true\nRestrictRealtime=true\nLockPersonality=true\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n<h3>Systemd Timer Unit: <code>\/etc\/systemd\/system\/borg-backup.timer<\/code><\/h3>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\">[Unit]\nDescription=Daily 02:00 UTC Bare-Metal Backup Schedule\nPersistent=true\n\n[Timer]\nOnCalendar=*-*-* 02:00:00 UTC\nRandomizedDelaySec=600\nPersistent=true\n\n[Install]\nWantedBy=timers.target<\/code><\/pre>\n<p>Activate and verify the timer units using standard systemctl commands:<\/p>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\">systemctl daemon-reload\nsystemctl enable --now borg-backup.timer\nsystemctl list-timers borg-backup.timer<\/code><\/pre>\n<div style=\"background:#1e293b;border-left:4px solid #38bdf8;padding:16px 20px;margin:24px 0;border-radius:0 8px 8px 0;color:#e2e8f0\">\n  <strong style=\"color:#38bdf8\">Architecture Note:<\/strong> Setting <code>RandomizedDelaySec=600<\/code> introduces an intentional 10-minute jitter across your server fleet. This prevents the &quot;thundering herd&quot; problem where hundreds of nodes simultaneously hammer internal upstream routers and cloud object storage endpoints at the top of the hour.\n<\/div>\n<h2>Phase 4: Bare-Metal Disaster Recovery Runbook<\/h2>\n<p>In the event of total server chassis loss, motherboard destruction, or catastrophic SSD failure, execute the following deterministic restoration procedure from a live Linux recovery ISO (such as SystemRescue or Debian Live).<\/p>\n<h3>Step 1: Partition and Format the Replacement Storage<\/h3>\n<p>Attach the new NVMe drive, configure network access, and pull down the offsite repository and metadata directory using Rclone:<\/p>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\"># Fetch metadata and repository from offsite storage\nrclone copy b2-encrypted:backup-vault\/server01\/metal-meta \/tmp\/metal-meta\nrclone sync b2-encrypted:backup-vault\/server01 \/mnt\/backup-vault\n\n# Re-apply exact partition geometry\nsfdisk \/dev\/nvme0n1 &lt; \/tmp\/metal-meta\/sfdisk-nvme0n1.dump\n\n# Format partitions and re-assign original filesystem UUIDs from blkid-mappings.txt\nmkfs.vfat -F32 -n \"EFI\" \/dev\/nvme0n1p1\nmkfs.ext4 -U \"$(awk '\/nvme0n1p2\/ {print $2}' \/tmp\/metal-meta\/blkid-mappings.txt | tr -d '\"')\" \/dev\/nvme0n1p2<\/code><\/pre>\n<h3>Step 2: Mount Target and Extract the Borg Archive<\/h3>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\"># Mount root and boot targets\nmkdir -p \/mnt\/target\nmount \/dev\/nvme0n1p2 \/mnt\/target\nmkdir -p \/mnt\/target\/boot\/efi\nmount \/dev\/nvme0n1p1 \/mnt\/target\/boot\/efi\n\n# Extract archive directly into target root preserving permissions, ACLs, and xattrs\ncd \/mnt\/target\nexport BORG_REPO=\"\/mnt\/backup-vault\"\nexport BORG_PASSPHRASE=\"YourSuperSecretEnterprisePassphraseHere\"\n\n# Locate latest archive name\nLATEST_ARCHIVE=$(borg list --short | tail -n 1)\n\necho \"Restoring from archive: $LATEST_ARCHIVE\"\nborg extract --numeric-ids --progress \"::$LATEST_ARCHIVE\"<\/code><\/pre>\n<h3>Step 3: Chroot, Reinstall Bootloader, and Restore EFI Entries<\/h3>\n<pre><code style=\"background:#0f172a;color:#38bdf8;padding:16px;border-radius:8px;display:block;font-family:monospace;font-size:13px;line-height:1.6\"># Bind virtual filesystems for chroot\nfor dir in \/dev \/dev\/pts \/proc \/sys \/run; do\n    mount --bind \"$dir\" \"\/mnt\/target$dir\"\ndone\n\n# Chroot into recovered system to reinstall GRUB\nchroot \/mnt\/target \/bin\/bash &lt;&lt;'EOF'\ngrub-install --target=x86_64-efi --efi-directory=\/boot\/efi --bootloader-id=GRUB --recheck \/dev\/nvme0n1\nupdate-grub\nupdate-initramfs -u -k all\nEOF\n\n# Clean unmount and reboot\numount -R \/mnt\/target\nreboot<\/code><\/pre>\n<h2>Actionable Frequently Asked Questions<\/h2>\n<details style=\"background:#1e293b;border:1px solid #334155;border-radius:8px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#38bdf8\">Why not run Borg directly over Rclone SFTP\/S3 without a local repository?<\/summary>\n<p style=\"margin-top:10px;color:#cbd5e1\">While Borg supports remote repositories over SSH (via the <code>borg serve<\/code> binary), it requires low-latency random read and write access to repository segment indexes. Running Borg directly across cloud object storage protocols (like S3 or B2) via FUSE or virtual mounts incurs massive HTTP GET\/PUT latency penalties and API request rate limits. Maintaining a fast local or LAN repository and using Rclone for asynchronous object sync provides the optimal blend of near-instant snapshot speed and resilient cloud durability.<\/p>\n<\/details>\n<details style=\"background:#1e293b;border:1px solid #334155;border-radius:8px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#38bdf8\">How does Borg handle live database files like MySQL, PostgreSQL, or Redis?<\/summary>\n<p style=\"margin-top:10px;color:#cbd5e1\">Never back up active database data directories (such as <code>\/var\/lib\/mysql<\/code> or <code>\/var\/lib\/postgresql<\/code>) directly without atomic filesystem freeze or flush mechanisms. Because Borg reads files sequentially, database blocks can mutate mid-read, resulting in torn pages and corrupted tables. Production environments must execute a pre-backup script executing <code>mysqldump<\/code>, <code>pg_dumpall<\/code>, or LVM\/ZFS copy-on-write snapshots prior to Borg archive creation.<\/p>\n<\/details>\n<details style=\"background:#1e293b;border:1px solid #334155;border-radius:8px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#38bdf8\">What happens if a network interruption occurs during an Rclone sync?<\/summary>\n<p style=\"margin-top:10px;color:#cbd5e1\">Borg repositories use append-only segment files identified by sequential hex numbers. When Rclone synchronizes the repository to an object store, it performs chunk-level checksum verification on each segment. If the network drops, Rclone resumes from the last successfully uploaded segment file on the next execution without re-uploading previously transferred blocks or corrupting the cloud repository.<\/p>\n<\/details>\n<details style=\"background:#1e293b;border:1px solid #334155;border-radius:8px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#38bdf8\">How do I prevent ransomware from wiping out my offsite backup repository?<\/summary>\n<p style=\"margin-top:10px;color:#cbd5e1\">Enable S3 Object Lock or Backblaze B2 Object Lock in &quot;Compliance Mode&quot; on your destination bucket with a mandatory retention period (e.g., 30 or 90 days). Even if an attacker gains root access to your Linux server and obtains your Rclone credentials, the cloud provider&#8217;s API will strictly reject delete, overwrite, or truncate commands on existing backup objects until the retention timer expires.<\/p>\n<\/details>\n<div style=\"background:linear-gradient(135deg, #0f172a 0%, #1e293b 100%);border:1px solid #334155;border-radius:12px;padding:32px;margin:40px 0;text-align:center\">\n<h3 style=\"color:#ffffff;margin-top:0;font-size:22px\">Ready to Deploy High-Performance Infrastructure?<\/h3>\n<p style=\"color:#cbd5e1;font-size:16px;line-height:1.6;max-width:680px;margin:12px auto 24px auto\">Experience blazing-fast NVMe storage, unmetered bandwidth, and enterprise LiteSpeed caching on CpanelFree.<\/p>\n<p>  <a href=\"https:\/\/cpanelfree.com\" style=\"background:#38bdf8;color:#0f172a;font-weight:700;padding:12px 28px;border-radius:6px;text-decoration:none;display:inline-block;font-size:15px\">Get Started with Free Cloud Hosting &rarr;<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Automate enterprise Linux bare-metal backups using BorgBackup deduplication and Rclone offsite sync. Achieve zero-loss disaster recovery with minimal storage.<\/p>\n","protected":false},"author":1,"featured_media":4667,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[172],"tags":[57,177,87,173,101],"class_list":["post-4668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security-hardening","tag-almalinux","tag-databases-performance","tag-devops","tag-security-hardening","tag-sysadmin"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=4668"}],"version-history":[{"count":0,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/4668\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/4667"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=4668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=4668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=4668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}