0

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.

Roger Creasy
  • 729
  • 2
  • 10
  • 17
  • Can you use rsync? – mdpc Sep 09 '16 at 20:01
  • @mdpc I wish I could! The OwnCloud system won't let me just copy the files into the folders for some reason. Regardless, I found the solution...I am about to post it as an answer. Thanks for reading and helping! – Roger Creasy Sep 09 '16 at 20:13

1 Answers1

0

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.

Roger Creasy
  • 729
  • 2
  • 10
  • 17
  • The OS stops interpreting once it hits a space. Adding " " makes it interpret the entire block, not just up to the space – colbyt Sep 09 '16 at 23:03