So I have a rsync script to copy files from my main computer onto my Libreelec external hard drive every time I boot up the computer.
The script works fine, but now I want to expand it and use rsync flags so it is a bit reasonable.
The following doesn't work. It should work, as it works fine on MacOS under bash:
Code
master:~/Master # ls -l try1.sh
-rwxr-xr-x 1 root root 624 Dec 29 08:14 try1.sh
master:~/Master # cat try1.sh
#!/usr/bin/bash
#Rsync Flags
export opt_ssh=(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no)
export opt_rsync=(--progress -rptuv --delete)
#Going to do Media2 (8TB HD) from scratch
export [email protected]
export DENUSER=/home/user
export [email protected]
export BASEMENTNASUSER=/home/user
export HOME1=/storage/Home/user
export MEDIA11=/storage/Media
export HOME2=/storage/Home2/user
export MEDIA21=/storage/Media2/Media1
export MEDIA22=/storage/Media2/Media2
rsync -e "${opt_ssh[*]}" "${opt_rsync[@]}" $DEN:/home/user/Documents $HOME2/Documents 2>>$locallog
sleep 21600
shutdown -h
master:~/Master # ./try1.sh
./try1.sh: line 4: syntax error: unexpected "("
master:~/Master #
Display More
It looks like the following lines aren't allowed on Libreelec bash
Code
export opt_ssh=(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no)
export opt_rsync=(--progress -rptuv --delete)
What should I do instead?
Added bash arrays to the title of the thread, since that seems to be the problem.