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.

2
  • Can you use rsync? Commented Sep 9, 2016 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! Commented Sep 9, 2016 at 20:13

1 Answer 1

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.

1
  • The OS stops interpreting once it hits a space. Adding " " makes it interpret the entire block, not just up to the space Commented Sep 9, 2016 at 23:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.