Add recycle bin to Samba
Before using windows Server for file sharing, if the client deletes a file in the shared folder, the deleted file cannot be found on the server. if a file is deleted by mistake on the client, the chances of file recovery will be very small.
Later, I checked some information on the Internet. The samba sharing function can be used to add the recycle bin function. the deleted files are directly placed in the configured recycle bin directory. you only need to add the following code to the configured shared file field:
# Recycle: repository =/samba/deleted/public/% U # specify the recycle bin directory of the shared folder. % U is stored separately by the username of the logon user.
Recycle: repository =/samba/deleted/public
Recycle: keeptree = Yes # specifies whether to store data according to the directory structure during Deletion
Recycle: versions = Yes # specify whether to overwrite files of the same name. yes indicates not to overwrite
Recycle: maxsixe = 0 # specify the size of the recycle bin directory. 0 is unlimited.
Recycle: exclude = *. tmp | *. mp3 # file type not placed in the recycle bin
Recycle: noversions = *. doc # specifies the file type that overwrites files of the same name.
Complete settings are as follows:
[Public folder]
Comment = public folder
Path =/samba/public # shared folder path
Read only = no # Whether the shared folder is read-only
Valid users = @ kfb, root # Use @ to specify accessible user groups. Use "," to separate different groups from users.
# Specify the default permissions when users create files or directories
Create mask = 0660
directory mode = 2770
force create mode = 0660
force directory mode = 2770
# Files that cannot be uploaded
Veto files =/*. mp3/*. mp4/*. rmvb/*. wma/*. exe/*. bat/*. dll/*. avi/*. rar
# Recycle bin settings
Vfs object = recycle
Recycle: repository =/samba/deleted/public
Recycle: keeptree = Yes
Recycle: versions = Yes
Recycle: maxsixe = 0
Recycle: exclude = *. tmp | *. mp3
Recycle: noversions = *. doc
Note: 1. the user and user group settings of the recycle bin folder must be the same as those of the shared folder. If they are inconsistent, the deleted files cannot be saved to the recycle bin folder. if maxsize is set to 0, the administrator needs to manually delete the files in the recycle bin. of course, the task of deleting files can be handed over to the scheduled task for completion, such:
Vim/etc/crontab
30 8 * root find/samba/deleted/-mtime + 30-exec rm-rf {}\;
The above setting is to delete files in the recycle bin more than 30 days at every day. 3. A separate recycle bin file should be set for each shared folder to avoid overwriting of files with the same name and facilitate management and search.
------------------------------------ Split line ------------------------------------
How to share files with Samba in Ubuntu 14.04
The speed of accessing samba from Ubuntu dual Nic of VMWare Virtual Machine doubles
Add the Samba File Sharing Server to the Windows Server 2003 Domain
Samba installation Configuration
Samba service configuration in CentOS 6.2
Samba Server installation and configuration
How to Build the Win7 + VMware + Fedora18 Samba Server
------------------------------------ Split line ------------------------------------
Samba details: click here
Samba: click here
This article permanently updates the link address: