Good evening. I have a new mac and a backup script that I found and adapted from the web does not work anymore (it works on my old mac).
it is a simple script for backing up the whole home dir on an external drive
#!/bin/bash
# A script to perform incremental backups using rsync
set -o errexit
set -o nounset
set -o pipefail
readonly SOURCE_DIR="/Users/username"
readonly BACKUP_DIR="link to folder in external drive"
readonly DATETIME="$(date '+%Y-%m-%d_%H:%M:%S')"
readonly BACKUP_PATH="${BACKUP_DIR}/${DATETIME}"
readonly LATEST_LINK="${BACKUP_DIR}/latest"
mkdir -p "${BACKUP_DIR}"
rsync -av --delete \
"${SOURCE_DIR}/" \
--link-dest "${LATEST_LINK}" \
--exclude=".cache" \
"${BACKUP_PATH}"
rm -rf "${LATEST_LINK}"
ln -s "${BACKUP_PATH}" "${LATEST_LINK}"
The first part of the error output is
: command not found
: command not found
: command not found
: invalid option namet: errexit
: invalid option namet: nounset
: invalid option namet: pipefail
: command not found
: command not found
: command not found
sending incremental file list
echo $path output is
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
but sudo nano /etc/paths feedback is
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin