I am trying to write an rsync script that would take the user inputed path to the source file and send it over to a another user inputed path on the remote machine.
#!/bin/bash
echo -e "What is the directory on the local machine you want to send"
read sourcedir
SOURCEDIR = :$sourcedir
echo -e "What is the directory on the GPU box you want to send these files over to?"
read destdir
DESTDIR = :$destdir
rsync -avu -e "ssh -p xxxx" $SOURCEDIR $DESTDIR user@remote.computer --progress
When i execute the script i get the following error
-bash: DESTDIR: command not found
building file list ...
rsync: link_stat "/path/to/script/user@remote.computer" failed: No such file or directory (2)
0 files to consider
sent 29 bytes received 20 bytes 98.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files could not be transferred (code 23) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-51/rsync/main.c(996) [sender=2.6.9]
Would appreciate your advice/suggestions on writing this script correctly.
PS. I have removed some sensitive information from the output, but rest assured the format is consistent with the output from the computer.