適用於客戶原有網芳檔案移轉至系統分享資料夾


系統分享資料夾路徑:

/mnt/cloudgwfiles/ArkEasePro/admin/files/systemFolders
Text


網域:

/mnt/cloudgwfiles/ArkEasePro/Domain/xxxxxxxx/admin/files/systemFolders
Text


step 1.

先 SSH 進入底層,建立一組帳號 ( admin )並加入 www-data 群組:

(/etc/arkease-pro/mount_davfs_for_ssh.sh)



sudo -s

useradd -g www-data admin

password admin


step 2.

修改跟 www-data一樣權限

vim /etc/password

將 admin 改成為 33:33


step 3.

mkdir /home/admin

chown admin:admin /home/admin

su admin

cd /home/admin

ln -s /mnt/cloudgwfiles/ArkEasePro/admin/files/systemFolders test


setp 4. 

測試權限是否能寫入

su admin

cd /home/admin/test

touch aa


step 5.

利用winscp 複製檔案至 /home/admin/test


step 6. 

執行filescan 

(不建議用root,雖然 files scan 只有做 read,以後有 write 操作的 這樣做 偏危險)


cd /opt/arkease-pro/www 

sudo -u www-data ./occ files:scan admin
Text

PS:系統分享資料夾權限是admin, 底層權限是 www-data


step 7.

UI 確認複製狀況


===========

Q&A:

後續查看總共掃了多少筆進DB:


MariaDB [(none)]> use owncloud

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Database changed

MariaDB [owncloud]> select * from oc_storages;



MariaDB [owncloud]> describe oc_storages;

+------------+-------------+------+-----+---------+----------------+

| Field | Type | Null | Key | Default | Extra |

+------------+-------------+------+-----+---------+----------------+

| id | varchar(64) | YES | UNI | NULL | |

| numeric_id | int(11) | NO | PRI | NULL | auto_increment |

+------------+-------------+------+-----+---------+----------------+

2 rows in set (0.00 sec)


MariaDB [owncloud]> SELECT * FROM oc_storages WHERE id like "%admin%";

+-------------+------------+

| id | numeric_id |

+-------------+------------+

| home::admin | 1 |

+-------------+------------+

1 row in set (0.00 sec)


MariaDB [owncloud]> SELECT COUNT(*) FROM oc_filecache

oc_filecache oc_filecache.mimepart oc_filecache.parent oc_filecache.size

oc_filecache.encrypted oc_filecache.mimetype oc_filecache.path oc_filecache.storage

oc_filecache.etag oc_filecache.mtime oc_filecache.path_hash oc_filecache.storage_mtime

oc_filecache.fileid oc_filecache.name oc_filecache.permissions oc_filecache.unencrypted_size


MariaDB [owncloud]> SELECT COUNT(*) FROM oc_filecache WHERE storage=1;

+----------+

| COUNT(*) |

+----------+

| 655875 |

+----------+

1 row in set (0.25 sec)