Difference between revisions of "CentOS 7.x Owncloud file cache and sharing"

From Notes_Wiki
m
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x_owncloud|CentOS 7.x owncloud</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x Web Based Tools|Web Based Tools]] > [[CentOS 7.x owncloud|owncloud]] > [[CentOS 7.x Owncloud file cache and sharing]]
=CentOS 7.x Owncloud file cache and sharing=


Table oc_filecache has cache information.  But that information is used in oc_share to understand which files are shared with whom.  Hence the information in that table is critical.  If there is a path issue then use:
Table oc_filecache has cache information.  But that information is used in oc_share to understand which files are shared with whom.  Hence the information in that table is critical.  If there is a path issue then use:
<pre>
  cd /var/www/html/owncloud/
  sudo -u apache php occ files:scan --all
</pre>


If the above --all option leads to "Out of memory error" on large deployments we can use:
<pre>
<pre>
  su - apache php occ files:scan --all
#Assuming data directory to be /mnt/files and most files owned by user admin
for A in $(ls /mnt/files/admin/files/); do
    echo "Going to execute" /usr/bin/sudo -u apache /usr/bin/php -f /var/www/html/owncloud/occ files:scan --path "admin/files/$A";
    /usr/bin/sudo -u apache /usr/bin/php -f /var/www/html/owncloud/occ files:scan --path "admin/files/$A";
done
</pre>
</pre>


For faster recovery we can also given path such as
For faster recovery we can also given path such as
<pre>
<pre>
   su - apache php occ files:scan --path "admin/files/HR DEP/hr2"
   sudo -u apache php occ files:scan --path "admin/files/HR DEP/hr2"
</pre>
</pre>
If apache is running with other user privileges eg apache then you may have to do '<tt>sudo -u apache</tt>' instead of '<tt>sudo -u daemon</tt>'
The above scan also helps with "File does not meet checksum issue" if any reported by owncloud client


'''In any case do not truncate or delete rows from oc_filecache manually or else all sharing will get broken. '''
'''In any case do not truncate or delete rows from oc_filecache manually or else all sharing will get broken. '''
Line 22: Line 35:


==For file locks error during scan==
==For file locks error during scan==
Go to maintenance mode, delete all rows from filelocks table and then switch of maintenance mode using:
We can get file locked error during scanning or also during regular operations via client / Web UI.  In such cases go to maintenance mode, delete all rows from filelocks table and then switch of maintenance mode using:
<pre>
<pre>
     sudo -u apache php occ maintenance:mode --on
    cd /var/www/html/owncloud
     sudo -u apache php -f occ maintenance:mode --on
 
     (With MySQL)  truncate table oc_filelocks;
     (With MySQL)  truncate table oc_filelocks;
     sudo -u apache php occ maintenace:mode --off
 
    cd /var/www/html/owncloud
     sudo -u apache php -f occ maintenance:mode --off
</pre>
</pre>
Refer [[CentOS 8.x Owncloud direct DB queries]] for connecting to owncloud database
Refer:
* https://central.owncloud.org/t/file-is-locked-how-to-unlock/985






<yambe:breadcrumb>CentOS_7.x_owncloud|CentOS 7.x owncloud</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x Web Based Tools|Web Based Tools]] > [[CentOS 7.x owncloud|owncloud]] > [[CentOS 7.x Owncloud file cache and sharing]]

Latest revision as of 09:49, 5 October 2022

Home > CentOS > CentOS 7.x > Web Based Tools > owncloud > CentOS 7.x Owncloud file cache and sharing

Table oc_filecache has cache information. But that information is used in oc_share to understand which files are shared with whom. Hence the information in that table is critical. If there is a path issue then use:

   cd /var/www/html/owncloud/
   sudo -u apache php occ files:scan --all

If the above --all option leads to "Out of memory error" on large deployments we can use:

#Assuming data directory to be /mnt/files and most files owned by user admin
for A in $(ls /mnt/files/admin/files/); do 
    echo "Going to execute" /usr/bin/sudo -u apache /usr/bin/php -f /var/www/html/owncloud/occ files:scan --path "admin/files/$A"; 
    /usr/bin/sudo -u apache /usr/bin/php -f /var/www/html/owncloud/occ files:scan --path "admin/files/$A"; 
done


For faster recovery we can also given path such as

   sudo -u apache php occ files:scan --path "admin/files/HR DEP/hr2"

If apache is running with other user privileges eg apache then you may have to do 'sudo -u apache' instead of 'sudo -u daemon'

The above scan also helps with "File does not meet checksum issue" if any reported by owncloud client

In any case do not truncate or delete rows from oc_filecache manually or else all sharing will get broken.

Refer:


For file locks error during scan

We can get file locked error during scanning or also during regular operations via client / Web UI. In such cases go to maintenance mode, delete all rows from filelocks table and then switch of maintenance mode using:

    cd /var/www/html/owncloud
    sudo -u apache php -f occ maintenance:mode --on

    (With MySQL)   truncate table oc_filelocks;

    cd /var/www/html/owncloud
    sudo -u apache php -f occ maintenance:mode --off

Refer CentOS 8.x Owncloud direct DB queries for connecting to owncloud database

Refer:


Home > CentOS > CentOS 7.x > Web Based Tools > owncloud > CentOS 7.x Owncloud file cache and sharing