updated paperless source and backup mount point directories.
This commit is contained in:
@@ -20,16 +20,16 @@ sudo su
|
||||
# ==============================================================================
|
||||
# This makes the script easier to read and modify.
|
||||
FSTAB_SOURCE="/etc/fstab"
|
||||
BACKUP_SOURCE="/mnt/5TB-Disk1/backup/" # Trailing slash is important to sync contents
|
||||
# BACKUP_SOURCE="/mnt/5TB-Disk1/backup/" # Trailing slash is important to sync contents
|
||||
CADDYFILE_SOURCE="/home/mattspeer/docker/caddy/Caddyfile"
|
||||
DDCLIENT_CONF_SOURCE="/etc/ddclient.conf"
|
||||
DDCLIENT_DEFAULT_SOURCE="/etc/default/ddclient"
|
||||
DNSMASQ_CONF_SOURCE="/home/mattspeer/docker/dnsmasq/dnsmasq.conf"
|
||||
HOMEASSISTANT_BACKUP_SOURCE_DIR="/home/mattspeer/docker/homeassistant/backups"
|
||||
NEXTCLOUD_BACKUP_SOURCE="/mnt/5TB-Disk1/backup/nextcloud"
|
||||
PAPERLESS_SOURCE="/doc-archive/export"
|
||||
PAPERLESS_SOURCE="/mnt/doc-archive/export"
|
||||
VAULTWARDEN_SOURCE_DIR="/home/mattspeer/docker/vaultwarden/data/"
|
||||
BACKUP_MOUNT_POINT="/mnt/airgap_drive"
|
||||
BACKUP_MOUNT_POINT="/mnt/26TB-Disk1"
|
||||
FSTAB_DESTINATION="$BACKUP_MOUNT_POINT/backup/server/os"
|
||||
BACKUP_DESTINATION="$BACKUP_MOUNT_POINT/backup"
|
||||
CADDY_DESTINATION="$BACKUP_MOUNT_POINT/backup/services/caddy"
|
||||
@@ -113,29 +113,29 @@ fi
|
||||
# ==============================================================================
|
||||
# Task 2: Sync backup directory
|
||||
# ==============================================================================
|
||||
echo "Starting rsync of '$BACKUP_SOURCE' to '$BACKUP_DESTINATION'..."
|
||||
# echo "Starting rsync of '$BACKUP_SOURCE' to '$BACKUP_DESTINATION'..."
|
||||
|
||||
# Check if the source directory for the backup exists.
|
||||
if [ ! -d "$BACKUP_SOURCE" ]; then
|
||||
echo "Error: Backup source directory '$BACKUP_SOURCE' not found." >&2
|
||||
# if [ ! -d "$BACKUP_SOURCE" ]; then
|
||||
# echo "Error: Backup source directory '$BACKUP_SOURCE' not found." >&2
|
||||
# Send a failure notification
|
||||
curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Error: Script failed. Backup source not found." "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
|
||||
exit 1
|
||||
fi
|
||||
# curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Error: Script failed. Backup source not found." "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
# The trailing slash on BACKUP_SOURCE is crucial. It tells rsync to copy the
|
||||
# *contents* of the directory, not the directory itself.
|
||||
rsync -av --progress "$BACKUP_SOURCE" "$BACKUP_DESTINATION"
|
||||
# rsync -av --progress "$BACKUP_SOURCE" "$BACKUP_DESTINATION"
|
||||
|
||||
# Post-rsync status check for the backup directory.
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Success: Backup directory has been successfully copied to '$BACKUP_DESTINATION'."
|
||||
curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Success: Backup copied to $BACKUP_DESTINATION" "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
|
||||
else
|
||||
echo "Error: rsync failed to copy the backup directory. Please check permissions." >&2
|
||||
curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Error: rsync failed to copy backup directory." "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
|
||||
exit 1
|
||||
fi
|
||||
# if [ $? -eq 0 ]; then
|
||||
# echo "Success: Backup directory has been successfully copied to '$BACKUP_DESTINATION'."
|
||||
# curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Success: Backup copied to $BACKUP_DESTINATION" "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
|
||||
# else
|
||||
# echo "Error: rsync failed to copy the backup directory. Please check permissions." >&2
|
||||
# curl -H "Authorization: Bearer $NTFY_TOKEN" -d "Error: rsync failed to copy backup directory." "$NTFY_SERVER/$NTFY_TOPIC" > /dev/null 2>&1
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
# ==============================================================================
|
||||
# Task 3: Sync photo directories
|
||||
|
||||
Reference in New Issue
Block a user