• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

How to rescan filesystem in owncloud 5

November 14, 2013 by Sharad Chhetri 9 Comments

In this post we will know how to rescan file system in Owncloud 5.x version.While working in owncloud I got the application called rescan but it was not working and I got a blank page.After exploring more into owncloud I got two ways to rescan the file system.

Owncloud Version: 5.0.22

Method 1: Using console.php file to rescan the owncloud filesystem.

Syntax:
For User:

/path/of/owncloud/console.php files:scan Userid

For full scan:

/path/of/owncloud/console.php files:scan --all

For eg. Here I have my these details. Hence the change the below given values as per your details

Owncloud installed path: /var/www/owncloud
Userid: sharad

/var/www/owncloud/console.php files:scan sharad

For full scan

/var/www/owncloud/console.php files:scan --all

Method 2: This method requires mysql server username and password. Here we will truncate the table which store the filesystem information.

The details of my mysql server
Note: Replace the value as per your information in given below fields.

Database Name: owncloud
Table Name: oc_filecache

Step 1: Login into mysql server

mysql -u root -p

Step 2: After login into mysql server you will mysql prompt (mysql >)

Change to owncloud database. Here for my owncloud server,I am using the database name owncloud.

mysql > use owncloud;

Step 3: Now truncate the table oc_filecache

truncate oc_filecache;

Clear filecache from database of particular user,follow the given below steps

Here, we are clearing filecache for user called sharad. First we will get its storage id then clear its rows from oc_filecache table

UserID = sharad

Step 1:

Note: Numeric_id for user called sharad is 2 and it is stoarge id which we will use it to delete its rows from oc_filecache.Hence check your table first and replace the 2 numeric_id value which you got from given below command

mysql> select * from oc_storages;
+---------------------------------------+------------+
| id                                    | numeric_id |
+---------------------------------------+------------+
| local::/var/lib/owncloud/data/admin/  |          1 |
| local::/var/lib/owncloud/data/sharad/ |          2 |
+---------------------------------------+------------+
2 rows in set (0.00 sec)

mysql> select  * from oc_filecache where storage = 2;
+--------+---------+-------------------+----------------------------------+--------+-------------+----------+----------+-------+------------+-----------+------------------+---------------+
| fileid | storage | path              | path_hash                        | parent | name        | mimetype | mimepart | size  | mtime      | encrypted | unencrypted_size | etag          |
+--------+---------+-------------------+----------------------------------+--------+-------------+----------+----------+-------+------------+-----------+------------------+---------------+
|      4 |       2 |                   | d41d8cd98f00b204e9800998ecf8427e |     -1 |             |        2 |        1 | 95102 | 1384442192 |         0 |                0 | 5284e95230eb2 |
|      5 |       2 | files             | 45b963397aa40d4a0063e0d85e4fe7a1 |      4 | files       |        2 |        1 | 95102 | 1384442218 |         0 |                0 | 5284e96a7b19c |
|      6 |       2 | files/mysql.png   | f876c595495bf53c3eefa2cca290ed53 |      5 | mysql.png   |        4 |        3 | 35405 | 1384442217 |         0 |                0 | 5284e969ab72e |
|      7 |       2 | files/mysql2.png  | 098fd1ef4694f1a9708fcac12c095192 |      5 | mysql2.png  |        4 |        3 | 58305 | 1384442218 |         0 |                0 | 5284e96a4006e |
|      8 |       2 | files/htaccess[1] | 30ba77b8d85dfe0b16c1f8fc70255225 |      5 | htaccess[1] |        6 |        5 |  1392 | 1384442218 |         0 |                0 | 5284e96ab674d |
+--------+---------+-------------------+----------------------------------+--------+-------------+----------+----------+-------+------------+-----------+------------------+---------------+
5 rows in set (0.00 sec)

mysql> delete from oc_filecache where storage = 2;
Query OK, 5 rows affected (0.08 sec)

mysql>

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. How to find which filesystem is supported by running kernel
  2. Linux command to find modified and access date of file/dir/filesystem
  3. 6 df Command Examples To Check Mounted Filesystem On Linux
  4. How to install owncloud in Ubuntu 12.10
  5. How to configure self signed SSL certificate in owncloud Ubuntu
  6. Your data directory and files are probably accessible from the internet because the .htaccess file does not work owncloud
  7. How to install owncloud in Debian Wheezy 7
  8. how to mount NAS storage in owncloud to keep all users data
  9. Reindex lucene search in owncloud 5.0.22
  10. Setup Owncloud 6 with self signed SSL certificate on Ubuntu 13.10

Filed Under: Linux, owncloud Tagged With: owncloud

Reader Interactions

Comments

  1. sharad chhetri says

    April 5, 2014 at 1:39 am

    OK,now I can see your question.
    The owncloud version is 6.x installed in Windows Server with IIS web server.

    Login into the database server and show me the output from table.

    follow the method 2

    Get user id from oc_storage table
    select * from oc_storages;

    Now , check the listed files/directory and path in oc_filecache table.

    replace user-id word and give numeric user id
    select * from oc_filecache where storage = user-id

    I just want to see , do this table have information related to this user.

    (Once clear the web browser cache also)

  2. sharad chhetri says

    April 5, 2014 at 1:28 am

    Hello Andre,

    Thanks for appreciating this post.
    I opened the owncloud forum link but it shown me the message “Topic not found”.
    Give me the “Question asked” with author name .I will look into the owncloud forum
    (My id in owncloud forum is sharadchhetri)

    I wrote this post the problem I faced on owncloud 5.x version.
    For solving scanning problem in my 1.2 TB Owncloud Data.It had taken time.

    Kindly let me know,what exactly is the issue.And how you are finding ,the scan is not done properly.
    (Note: If you are searching file name in Search box,it uses lucene. For lucene problem,troubleshooting is different.
    The lucene solution I have posted in this article.
    )

  3. Andre says

    April 4, 2014 at 4:14 pm

    Thanks for this article. Wondering if you have a moment to help with this? http://forum.owncloud.org/viewtopic.php?f=26&t=20701
    Sounds a little bit like the issue you solved but your solutions aren’t giving me a result. Thanks so much!

  4. sharad chhetri says

    March 10, 2014 at 4:23 am

    Hello Jaroslav,

    owncloud/data directory in Server has the actual Data. The owncloud/dir directory has subdirectory with the username. If you explore these subdirectory you will find the data inside these directory.

    First take the mysql database backup

    Then apply method 2 – truncate oc_filecache
    Then apply Method 1 – console.php scan

    I did not get which you have written “Browsing some folders leads to recursive jump to root.”.
    Is this happening when you are log in server with command line and using cd command to go into directories ?

  5. Jaroslav says

    March 9, 2014 at 7:55 pm

    Hi,

    I’ve the same problem. Web interface shows several folders twice. I cannot store some (just some) folders, they are deleted in few seconds.
    Browsing some folders leads to recursive jump to root.
    I tried to disable deleted files and versions. Still no success. Rescan works ok, but with no effect …Any idea, please?

    Jaroslav

  6. sharad chhetri says

    February 12, 2014 at 8:26 am

    Hello Irfan,

    Thanks for appreciation.
    I have not tested the active directory with owncloud still so far.
    Can you scan the data directory with below given two commands
    console.php is found at /var/www/html/owncloud [Replace with owncloud web directory path as per your Server info]

    (1) php console.php files:scan [user_id directory,Owncloud creates a data directory of user_id with its same name, you can see at ls -ld /var/www/html/owncloud/data/* ]

    (2) php console.php files:scan –all [It rescan all users filesystem means their data directory]

    These two command will not give any problem,it is safe ๐Ÿ™‚
    Suggest you to try with 1st command,if it is able to scan the data directory of user_id . If successful then go for second command for all users

    Try once, and let me know the feedback.

  7. Irfan Ahmed says

    February 12, 2014 at 5:35 am

    Thanks , it scans for the users created on owncloud, but it is not scanning files for Active directory created users.

  8. sharad chhetri says

    December 19, 2013 at 5:04 am

    Hi Martin,
    Thanks for appreciation.I faced same problem which you are facing hence I did all steps which I have written.
    Let me know if still facing the issue.

    Thanks and Regards
    Sharad

  9. Martin says

    December 18, 2013 at 7:46 pm

    Hi Sharad,

    thanks for this article. The first method solved incorrect folder size on the webinterface.

    Now I just need to correct to correct the quota….which displays 2 GB (while having actually used > 30 GB.

    Best regards

    Martin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Commands

grep command to remove commented lines

Head command in Linux / Unix

FAQ on CentOS 7 / RHEL 7 : Alternate of ifconfig command

Learn tar command and know about its precaution

Command to create and delete group in Red Hat and CentOS linux

awk command to search keyword or strings in file

How to find installation date and time of rpm package

Explore 70+ Articles On Linux Commands

Always Useful Tips And Tricks

How to install korn shell ksh in Linux

Nagios HTTP WARNING: HTTP/1.1 403 Forbidden

Do not show line haveing particular keyword by grep command

How to empty Trash through command line in Ubuntu

Recover Linux Grub Password in linux rescue mode CentOS/Red Hat

sed: -e expression #1, char 24: Invalid range end

Read the file inside compressed .gz files without extract

Explore 90+ Article On "Linux Tips And Tricks"

You Might Like These Articles!

Internal External Command

What is Linux/Unix Internal And External Command

Linux basic command

Linux Basic Commands With Examples For Every Beginner

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission but Schools and Colleges can do in their Private Network
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy