Local sync with NextCloud

I’m using NextcloudPi on a Raspberry Pi (Nextcloud 13).

Here’s a few more tips which tidy up the files you’ve copied in:

After doing a giant copy of files into my Nextcloud user’s data folder (as above), I corrected the file and directory ownerships with the following (running this from the Nextcloud user’s data folder which I had just copied into):

chown -R www-data.www-data *

…then I cleaned up the permissions on the newly-copied files and folders like this:

find . -type f -print0 | xargs -0 -iHeRe chmod 644 HeRe
find . -type d -print0 | xargs -0 -iHeRe chmod 755 HeRe

This gives all files “-rw-r–r–” permissions, and all folders “drwxr-xr-x” permissions.

Finally I deleted any and all junk “desktop.ini” files (which Windows had annoyingly and automatically added earlier):

find . -name "desktop.ini" -print0 | xargs -0 -iHeRe rm HeRe

The “scanning” command I had to do in NextcloudPi looked like this instead (note absolute pathname to “occ”, also the absense of two dashes before the Nextcloud username, which was “ncp” in my case):

sudo -u www-data php /var/www/nextcloud/occ files:scan ncp