Delete a folder bypassing Trash

Guys inside the owncloud server I want to delete a folder which is about 500GB in size but I don’t want to send it to the trash bin. Is there a way to delete it so that it does permanently skipping the trash? if. I send it to the trash the file server will go to 99% disk space used and it will become a problem so I need to delete it without going to the trash.

Please let me know.
Teo

There are some options you can use documented in Config.php Parameters :: ownCloud Documentation

For the trashbin_skip_size_threshold option, it basically applies to files. It won’t apply properly to folder because the FS usually reports the size of folder very badly (either 0 or 4KB regardless of the contents) so it’s quite unreliable to use it for folders.

If you want to delete the whole folder, I think you could:

  1. Setup a folder that will be used to bypass the trashbin, for example
    'trashbin_skip_directories' => [
        'temp',
    ],
    
  2. Create that “temp” folder
  3. Move your folder inside the new “temp” folder
  4. Delete your folder from there

Note that step 3 is expected to be a move inside the same FS, so it should be fast.

If you’re using an external storage, make sure you setup that “temp” directory inside the same external storage to avoid moving the folder inside the ownCloud server.
You’ll likely need to change the “temp” folder to something like “SMB/myroot/temp”.

Lastly, I’d suggest to test the setup before deleting that folder. These options are available in the last versions (checked with 10.9, maybe 10.8)

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.