Скрипт Rsync работает только в локальном каталоге

Для проверки своих возможностей rsync на сервере я настроил небольшой скрипт:

Код:

#!/bin/bash
read -p "Please indicate the path to the file on local machine: " LOCALFILE


read -p "Please indicate the path to the destination file on the server: " DESTFILE


rsync --progress -avz -e "ssh -i ~/Documents/Keys/notrealkeyname.pem" $LOCALFILE ubuntu@notrealservername:$DESTFILE

Однако, я получаю это после попытки запустить команду

Код:

myuser@myuserLinux:~$ cd .bin
myuser@myuserLinux:~/.bin$ ./sendtoserver
Please indicate the path to the file on local machine: ~/Pictures
Please indicate the path to the destination file on the server: ~/Pictures
sending incremental file list
rsync: change_dir "/home/myusername/.bin//~" failed: No such file or directory (2)
sent 20 bytes  received 12 bytes  21.33 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

Я думаю, что основная проблема заключается в этом, но не знаю, как это исправить:

rsync: change_dir "/home/myusername/.bin//~" failed: No such file or directory (2)

Если я помещу ~ / Pictures в ~ / .bin затем это будет работать, но, очевидно, я не хочу помещать все мои файлы в одну папку.

0
задан 13 September 2019 в 22:06

0 ответов

Другие вопросы по тегам:

Похожие вопросы: