Nextcloud version (eg, 12.0.2): 14.0.3
Operating system and version (eg, Ubuntu 17.04): CENTOS 7.5 kvm
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4
PHP version (eg, 7.1): 7.0
The issue you are facing: I’m trying to transfer ownership of a specific directory from one user (user1) to another user (user2) but files:transfer-ownership script fails. It says it can’t find the path I provide. I’ve tried all kinds of paths to the directory but none ever work. The user I’m running php as is the owner of /nextclouddata and all the files. I even tried absolute path and it still doesn’t work.
Is this the first time you’ve seen this error? (Y/N): Y
Steps to replicate it:
Try out files:scan, you can see the path exists and scripts work:
synyc@ds1055 [~/cloud.synyc.org]# php occ files:scan --path="user1/files/MyTempShare"
Starting scan for user 1 out of 1 (user1)
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 2 | 5 | 00:00:02 |
+---------+-------+--------------+
Now Try files:transfer-ownership with path:
synyc@ds1055 [~/cloud.synyc.org]# php occ files:transfer-ownership --path=“/user1/files/MyTempShare” user1 user2
Unknown path provided: “/user1/files/MyTempShare”
or
synyc@ds1055 [~/cloud.synyc.org]# php occ files:transfer-ownership --path=“/home/synyc/nextclouddata/user1/files/MyTempShare” user1 user2
Unknown path provided: “/home/synyc/nextclouddata/user1/files/MyTempShare”
Here’s the directory:
synyc@ds1055 [~/cloud.synyc.org]# ls -ltr /home/synyc/nextclouddata/user1/files/MyTempShare
total 42384
-rw-r--r-- 1 synyc synyc 1817094 Sep 28 19:59 IMG_2427.JPG
-rw-r--r-- 1 synyc synyc 2512754 Sep 30 19:58 DanceDJY-Ad-1-4-2016.pdf
-rw-r--r-- 1 synyc synyc 39067012 Oct 5 19:37 RPL8ftStraight-SY19_Folder.zip
drwxr-xr-x 2 synyc synyc 68 Oct 18 03:25 Taco
Just FYI, the --help for the command … seems like it should work to transfer ownership of just 1 dir vs everything:
synyc@ds1055 [~/cloud.synyc.org]# php occ files:transfer-ownership --help
Usage:
files:transfer-ownership [options] [--] <source-user> <destination-user>
Arguments:
source-user owner of files which shall be moved
destination-user user who will be the new owner of the files
Options:
--path=PATH selectively provide the path to transfer. For example --path="folder_name" [default: ""]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--no-warnings Skip global warnings, show command output only
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help:
All files and folders are moved to another user - shares are moved as well.
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => 'xxx',
'passwordsalt' => 'xxx',
'secret' => 'xxx',
'trusted_domains' =>
array (
0 => 'cloud.synyc.org',
),
'datadirectory' => '/home/synyc/nextclouddata',
'overwrite.cli.url' => 'https://cloud.synyc.org/',
'htaccess.RewriteBase' => '/',
'htaccess.IgnoreFrontController' => true,
'dbtype' => 'mysql',
'version' => '14.0.3.0',
'dbname' => 'xxxx',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'xxx',
'dbpassword' => 'xxxx',
'installed' => true,
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'memcache.local' => '\\OC\\Memcache\\APCu',
'mail_from_address' => 'nc-noreply',
'mail_smtpauth' => 1,
'mail_domain' => 'synyc.org',
'mail_smtpport' => '465',
'mail_smtpname' => 'nc-noreply@synyc.org',
'mail_smtppassword' => 'xxxxx',
'mail_smtpsecure' => 'ssl',
'mail_smtphost' => 'mail.synyc.org',
'updater.secret' => 'xxxx',
);