How to get deleted files in SMB/CIFS

  • Hi,


    I discovered the same behavior with SMB/CIFS, already in OMV 3. There are several threads here in this forum regarding this.


    If it works correctly you should find a folder ".recycle" in the root folder of your share.


    I am currently using recycle.bin with my SMB/CIFS share under OMV3. But I didn´t use the button in the webUI of OMV, because it didn´t worked for my also. I have configured it diffently. But it was some time ago and I have to look what I have done precisely, but soonest next weekend, sorry.

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

  • Hi,


    Thank you for answering


    I use OMV version 4.1.3-1(Arrakis)


    After activating the "recycle bin" button in the WEB interface, I could not find a folder called ".recycle" in the sharing root folder. there is obviously a problem with this. You can configure the process in a different way. I would appreciate it if you look at this configuration over the weekend and share it with me.

  • Might be the .recycle folder is created only when the first file is deleted.

    Yes, indeed. The folder is created once you delete a file.

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

  • Ok, I double checked my OMV installation... And it seems I have activated the "Enable recycle bin" switch in the share settings only. Still no special configuration.



    I only added one line in the "extra options" field of each share:
    recycle:exclude_dir = .recycle
    This avoids deleting the .recycle folder itself creates a new .recycle folder.


    I also tried to define a period of days for automatic deletion of the recycle bin. But this didn´t worked for me, because my NAS is not running 24/7. Therefore i am using a script which I have have adopted from here:
    Automatisches Löschen des Samba-Papierkorbs auf einem FreeNAS/NAS4Free Server (Sorry, this is a German blog)
    I have modified the mentioned script "delrecycle.sh" a little bit and call it every time when the NAS is started. It is also possible to do this by a cron job.


    Two additional hints:

    • Don´t edit /etc/samba/smb.conf manually! Changes may be overwritten by OMV.
    • You can check the your samba settings with the command testparm

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    2 Mal editiert, zuletzt von cabrio_leo ()

  • Thank you for your help.


    When I leave the values here as 0, the .recycbin file comes out after deleting something in each folder. That's exactly what I wanted.


    Users could see the "reycbin" file as a hidden file in SBC / CIFS. This situation is not what I want. When I add as follows, I'm preventing users from seeing the "recycbin" file, and only the admin can see the "recycbin" file on the command line (Ubuntu) and it was very good for us.


    /etc/samba/smb.conf
    Global setting


    unix extensions = no
    veto files = /.*
    delete veto files = yes


    Finally I added the "reycbin" file in the cron tab line so that it doesn't grow in capacity. (last 7 days to stay)


    find /sharedfolders/XXXX/.recycle/ -type f -mtime -7 -delete

  • /etc/samba/smb.conf

    I hope you have not edited this file directly but used the general SMB/CIFS settings page of the WebUI.

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!