Nethserver

From Blue-IT.org Wiki

Revision as of 10:58, 28 July 2019 by Apos (talk | contribs) (Created page with "== Nextcloud == === Mass import of files === * See: https://docs.nextcloud.com/server/14/admin_manual/configuration_server/occ_command.html#scan Import all files to the data d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Nextcloud

Mass import of files

Import all files to the data directory of the specified nextcloud user (user_id):

[root@nethserver#>]
myNextcloudUser=user_id;
cd /usr/share/nextcloud/data/${myNextcloudUser}/files
rsync -av /backup_of_data/${myNextcloudUser}/files/. .
chown -R apache:apache .

Then you can import everything with the following command:

Important: use php71, or you get an error!

# for all users 
/usr/bin/sudo -u apache /usr/bin/php71 /usr/share/nextcloud/occ files:scan --all

# for the given user only
/usr/bin/sudo -u apache /usr/bin/php71 /usr/share/nextcloud/occ files:scan ${myNextcloudUser}

You should see something like this:

Scanning files for 2 users
Starting scan for user 1 out of 2 (username)
+---------+--------+--------------+
| Folders | Files  | Elapsed time |
+---------+--------+--------------+
| 28585   | 107801 | 02:11:30     |
+---------+--------+--------------+