So, I'm writing a backup script, and wanted to skip .iso files.
If I use the command from the command line, everything works fine:
rsync -a --delete --exclude='*.iso' /home/user/Desktop/Work /mnt/profile/Desktop/
But, when I try to use it inside my script, is doesn't get the "EXCLUDE" settings, and proceed to copy .iso files. This is the script:
#!/bin/bash
set -e
SRC_DIR="/home/user/Desktop/Work"
DST_MOUNTPOINT="/mnt/profile"
DST_DIR="/mnt/profile/Desktop/"
OPTIONS=" --exclude='*.iso' "
mountpoint -q $DST_MOUNTPOINT || mount $DST_MOUNTPOINT
rsync -a --delete $OPTIONS $SRC_DIR $DST_DIR
If I run the script, get its PID and check /proc/PID/cmdline, the EXCLUDE settings is there.
What I'm doing wrong?