Hi
I’ve been running a homelab for some time now, with both successes and many failures
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 ![]()
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