How to move files/directories to one user unixto another, and get it in owncloud?

Hi here, I'd like to know how to move some directory/files in owncloud with using SSH/shell instead of using web UI.

I have one Unix user with a lot of directory/file and I'd like to put it into my owncloud user.

I tryed

Steps to reproduce
1.move one file into owncloud/www/data/samp/files/Documents and give chmod to owncloud.
2.take a look to owncloud Web interface, but he is not on it.

Expected behaviour
To see my file in my owncloud user.

Server configuration
Operating system:jessi/debian
Web server:apache2
PHP version:5,
ownCloud version (see ownCloud admin page):9.1.3

Unfortunately your original use case is not supported in ownCloud as your not allowed to modify files within the ownCloud data directory as stated at a few places within the documentation.

See the following FAQ for background info and alternatives:

1 Like

I had the same problem, because I started to sync the local files with wrong user. There is an easy solution making use of occ directly on the server. The file permissions don't have to be changed, because the local permissions are www-data (or whatever user your apache server is running as). I had two users usera and userb and the task was to move one folder from usera to userb. I moved the folder manually from usera to userb and ran the following commands:

cd /var/www/owncloud
sudo -u www-data php occ files:scan
sudo -u www-data php occ files:scan

This will rescan the files and change the database accordingly. Before you start you should either disable the sync process on the clients or stop apache until the process is finished.

Attention: Depending on the amount of files this process may take a while. Remain patient! For 1600 files it took 12 minutes.

I recommend that you make a backup of the database and folders before you start this process. Use at your own risk.