I am trying to copy files from my primary data storage server into an OwnCloud instance. The data storage server has successfully mounted the user's directory on the OwnCLoud server, via webdav. I can copy files from the data server to the OwnCloud server; I can mkdir on OwnCLoud from the data server. However, I cannot recursively copy a directory from the data server. I get, for each directory I am trying to copy:
cannot create directory '/path/to/dir\ with\ spaces\ in\ name': Invalid argument
Here is the command I am using:
cp -R /dir/* /mnt/point/
Both servers are Linux. However, there are windows file and directory names (with spaces) in the directory I am trying to copy. I think that the issue is with the directory name having spaces in it.
I found the solution. The problem does seem to have been in the naming of directories. Instead of using the slash delimiter for the space, I had to wrap the directory names in quotes. (I didn't know Linux saw any difference in the 2 methods)
In the commands where I was using directory names, this did not work:
/path/to/dir\ with\ spaces\ in\ name
This did:
"/path/to/dir with spaces in name"
If anyone knows why, I would love to know.