Skip to content

Exlude particular directories from beeing viewed, accessed and scanned  #15385

Closed

Description

@mmattel

I came across this when I did some debugging on SMB, but this is not limited to.

My external storage is capable of snapshots. These snapshots are present in each directory and have as entrypoint a particular directory name. I can enable the view on this directory from the storage point of view, then when you browse with your desktop and enter the snapshot directory name, you can walk into. If I disable this view, I can enter the snapshot directory name, but it behaves like a non existing folder.

As this is a good thing to recover files without tape access, enabeling the view has its benefits.

The bad thing with the current behaviour of owncloud is, if you have a TB volume shared, snapshot directory access enabled and let´s say 10 snapshots you rotate, you scan 11TB (1 + 10)...
And each rescan does then the same
And each mount point does the same.

The idea is now, that there is a possibility in owncloud to exlude the view, access and scan of these directories. Maybe a config.php parameter array with names to exclude.

In my case, the folder names to exclude would be ~snapshot and .snapshot
(The first character is access protocol dependent, ~ = SMB, . = NFS)

Please consider, that these kind of storages are more likely to be found in enterprise environments, but then snapshots are liked and heavily used ...

Activity

  1. Aesculapius commented on Apr 7, 2015

    @Aesculapius

    Yes, being able to exclude folders from being scanned also fits my usecase, where incremental backups using hardlinks would result in terabytes of storage to be scanned. Also see #7234

  2. DeepDiver1975 commented on Apr 8, 2015

    @DeepDiver1975
    Contributor

    Please have a look at config.sample.php - there is a option to blacklist files/folders.

    Please give it a try if this works out for you.

  3. mmattel commented on Apr 8, 2015

    @mmattel
    ContributorAuthor

    Good hint.

    The config.php parameter: blacklisted_files is for files only, but not for directories
    https://github.com/owncloud/core/blob/master/config/config.sample.php

    static public function isFileBlacklisted($filename) {

    But there is another function just below:

    static public function isIgnoredDir($dir) {

    /**
     * check if the directory should be ignored when scanning
     * NOTE: the special directories . and .. would cause never ending recursion
     * @param String $dir
     * @return boolean
     */
    static public function isIgnoredDir($dir) {
        if ($dir === '.' || $dir === '..') {
            return true;
        }
        return false;
    }
    

    This would do what we expect, at least from the scanning point of view, maybe also from viewing. Just needs to be expanded to a config.php parameter maybe blacklisted_directories

  4. added this to the backlog milestone on Mar 1, 2016
  5. PVince81 commented on Sep 23, 2016

    @PVince81
    Contributor

    @mmattel since your PR was merged I guess this can be closed ? Or is something missing ?

  6. mmattel commented on Sep 25, 2016

    @mmattel
    ContributorAuthor

    Closing because of merging #19235

  7. lock commented on Aug 3, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  8. locked as resolved and limited conversation to collaborators on Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions