当从硬盘copy 10T的数据到nextcloud的时候,copy到data目录下,web端是看不到的。因为copy的文件,在数据库里面没有记录的。
1,occ有三个用于管理Nextcloud中文件的命令
files:cleanup #清楚文件缓存
files:scan #重新扫描文件系统
files:transfer-ownership #将所有文件和文件夹都移动到另一个文件夹
2,files:scan来将文件加入系统中
files:scan 来扫描新文件。
格式:
files:scan [-p|--path="..."] [-q|--quiet] [-v|vv|vvv --verbose] [--all]
[user_id1] ... [user_idN]
参数:
user_id #扫描所指定的用户(一个或多个,多个用户ID之间要使用空格分开)的所有文件
选项:
--path #限制扫描路径
--all #扫描所有已知用户的所有文件
--quiet #不输出统计信息
--verbose #在扫描过程中显示正在处理的文件和目录
--unscanned #仅扫描以前未扫描过的文件
3,样例
zhangying nextcloud$ cd /www/nextcloud //切换到nextcloud web目录 zhangying nextcloud$ php occ files:scan --all //扫描所有用户 Starting scan for user 1 out of 8 (1582xxxx351) Starting scan for user 3 out of 8 (aabbcc) Starting scan for user 4 out of 8 (admin) Starting scan for user 5 out of 8 (lilianghan) Starting scan for user 6 out of 8 (tank) Starting scan for user 7 out of 8 (tankzhang) Starting scan for user 8 out of 8 (zhangying) +---------+-------+--------------+ | Folders | Files | Elapsed time | +---------+-------+--------------+ | 56 | 118 | 00:00:01 | +---------+-------+--------------+ zhangying nextcloud$ php occ user:list //显示所有用户 - 1582xxxx351: 张映 - aabbcc: aabbcc - admin: admin - lilianghan: lilianghan - tank: tank - tankzhang: tankzhang - zhangying: 张映 zhangying nextcloud$ php occ files:scan 1582xxxx351 //只扫描某一用户 Starting scan for user 1 out of 1 (1582xxxx351) +---------+-------+--------------+ | Folders | Files | Elapsed time | +---------+-------+--------------+ | 7 | 16 | 00:00:00 | +---------+-------+--------------+ zhangying nextcloud$ php occ files:scan 1582xxxx351 --path="/1582xxxx351/files/技术部" //指定用户和目录扫描 Starting scan for user 1 out of 1 (1582xxxx351) +---------+-------+--------------+ | Folders | Files | Elapsed time | +---------+-------+--------------+ | 1 | 5 | 00:00:00 | +---------+-------+--------------+ zhangying nextcloud$ php occ files:scan 1582xxxx351 --path="/__groupfolders/1" //目录报错 Unknown user 1 __groupfolders +---------+-------+--------------+ | Folders | Files | Elapsed time | +---------+-------+--------------+ | 0 | 0 | 00:00:00 | +---------+-------+--------------+
--path后面根"用户名/files/文件夹名",这里不是服务器的路径,而是web端登录后,路径
转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/server/2235.html