Please note: I need to insert some spaces in URLs, because of the restrictions of StackOverflow.
I have a FreeBSD server. I need to backup my previously tar.gz databases on a WebDav cloud storage as Yandex Disk or Box.com or 4Shared.
Everything works fine with Putty, command line after command line. I am be able to upload my file on Yandex Disk:
%cadaver
dav:!> open https://webdav.yandex.com
Authentication required for Yandex.Disk on server `webdav.yandex.com':
Username: MyUserName
Password:
dav:/> put MyFile.tar.gz
Uploading MyFile.tar.gz to `/MyFile.tar.gz':
Progress: [=============================>] 100.0% of 1229518 bytes succeeded.
dav:/> exit
Connection to ` webdav . yandex . com' closed.
%
However, my bash script fails to upload my file.
Here is my bash script "criptdav.sh":
#!/bin/sh
/usr/local/bin/cadaver < datadav
Here is my "datadav" file:
open https:// webdav . yandex . com
MyUserName
MyPassword
put MyFile.tar.gz
exit
Here is Putty screenshot of my bash script:
%sh scriptdav.sh
dav:!> open https://webdav.yandex.com
Authentication required for Yandex.Disk on server `webdav.yandex.com':
Username: MyUserName
dav:/>
Connection to `webdav.yandex.com' closed.
%
Nota Bene:
I tried with Yandex, Box, 4Shared. Same result. Script fails to upload my file.
QUESTION:
What's wrong with my bash script?