Rsync backup to NTFS USB Drive

Hi

I’ve been running a homelab for some time now, with both successes and many failures :slightly_smiling_face: But it’s a lot of fun, so I’m not thinking about quitting anytime soon.

One of the most important things for me is not losing data, especially not my own. Because of that, I’m planning to use rsync to backup data to an external USB drive with an NTFS partition connected to my server.

The main goal is to backup my wife’s data so she can easily access her files if everything stops working. She mostly uses Windows, so it’s important that the backup drive uses NTFS. I want to avoid a situation where she plugs the drive into a Windows computer and sees the message:
“You need to format the disk before you can use it. Do you want to format it?”

I’m planning to use Jay’s backup script template from the guide “How to Automate Linux Backups Using rsync and systemd.”

My question is, should I add anything else to the template, such as running “sync” at the end, to avoid unexpected problems?

I’d really appreciate any help or suggestions :slightly_smiling_face:

Template:

#!/bin/bash

backup_src="/home/jay/my_files"
backup_mount="/mnt/backup"
backup_dest="$backup_mount/current"
current_date=$(date +%Y-%m-%d)
log_path="$backup_mount/logs"
previous_files="$backup_mount/files_previous/$current_date"

healthcheck_url="https://hc-ping.com/..."

# Create required directories
#mkdir -p "$log_path"
#mkdir -p "$previous_files"

# Run rsync
#rsync -av --delete --backup \
#  --backup-dir="$previous_files" "$backup_src" "$backup_dest" \
#  > "$log_path/backup_$current_date.log" \
#  2> "$log_path/backup_${current_date}_error.log"

echo "test"

# Alert halthchecks.io that rsync was successful:
if [ $? -eq 0 ]; then
  curl -fsS "$healthcheck_url" >/dev/null
fi

Hi @rafal , is your goal to backup the Windows PC to the server with the attached storage drive and to use that same storage drive to sometimes connect it to the Windows PC? Or to just always keep the storage drive attached to the server?

Hi

We are using Nextcloud on TrueNAS Scale. All data is stored in TrueNAS datasets, which are mounted in Nextcloud as external storage.

An external NTFS drive will be permanently connected to the server. Once a day, I want to use rsync to back up my wife’s data from the TrueNAS datasets to this drive as a reliable backup.

I asked the same question on the TrueNAS forum. If you want to check it, here is the link to Truenas forum