Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the samba recycle plugin and have the following in my [global] section

recycle:exclude = *.~lock*
recycle:repository = .recycled
recycle:versions = yes
recycle:keeptree = yes
vfs objects = recycle

I would like to disable this feature for a particular share. I've tried putting vfs objects = within the share definition, but this has no effect. I've also tried putting recycle:exclude = * inside the share definition, but this didn't work either. And finally I tried setting (in the [global] section) recycle:exclude_dir = /home/path/to/my/dir/ which looked promising from the man page

I understand how to disable .recycle completely but this is not what I want.

[edit suggested by helpful commenter below!]

The path in question is monitored by a Dropbox daemon. This is why I don't want a Recycle bin - it will effectively cause a 2nd bandwidth-hogging upload, and the .recycled/ copy is unnecessary because Dropbox versions files anyway.

share|improve this question
Would it be an option to, inside the folder where the plugin keeps your recycle bin, create a folder with the same name as the dropbox one where the plugin has no rights to write on? It would fault out, but at least it would not fill the recycle share with dropbox files... – Bruno Pereira Jul 26 '12 at 18:13
Yes, that's an option, but it would be ideal to get the thing to run without errors because I like to use errors to tell me there's something wrong. You're right, this would solve the upload bandwidth issue, though, thanks. – artfulrobot Jul 27 '12 at 20:55
Let us hope brain comes out with a better solution, I do not thing its possible only using the recycle bin plugin, but then again we never know all about everything. gl! – Bruno Pereira Jul 27 '12 at 21:28
@BrunoPereira actually, your suggestion worked. I had tried 000 but this caused errors as Dropbox could not read the folder, but 555 means samba can't write to it, so there's nothing there for Dropbox to read, but no errors on the dropbox side. – artfulrobot Dec 6 '12 at 14:32
up vote 2 down vote accepted

There's a bit of a work around, just assign permissions 000 to the recycle bin folder on your share, it will still be there, but no files will be written into it. I had to do this on my backups folder, because Windows writes and then deletes so many files backing up.

share|improve this answer
000 causes errors as Dropbox could not read the folder, but 555 means Dropbox won't error but samba won't write files to it. Works for me, thanks. – artfulrobot Dec 6 '12 at 14:33

I do not think this is possible only for 1 share using the samba recycle bin plugin, you might be better off with a scrip used in cron running every minute or so that clears up that folder inside the recycle bin share.

Something like rm -rf /home/path/to/my/dir/* added to cron will save you the trouble of worrying about the samba configuration.

Schedule a job with cron using crontab -e and add the line

*/10 * * * * /bin/rm -rf /home/path/to/my/dir/*

to make it run every 10 minutes and clear anything inside /home/path/to/my/dir/.

share|improve this answer
Yep, could do that normally, thanks for your time + suggestion. Problem is that the folder I don't want to have a recycle bin for is a Dropbox folder. Dropbox versions files anyway, so a recycle bin is wasted bandwidth. It will trigger immediately, so a 10 (or even 1) minute cronjob won't solve the problem. – artfulrobot Jul 26 '12 at 13:59
@artfulrobot you should add that to your question so user know what they are facing ;) – Bruno Pereira Jul 26 '12 at 14:03

If it really is a limitation of the plugin that it can only work globally, a solution particular to this situation only would be to change the .recycled path to /somewhere/else/ and then, if necessary, symlink to /somewhere/else/... from the other paths. This is obviously messy, and symlinks cause problems in a mixed OS environment (e.g. Linux will try to resolve locally while Windows gets the server to resolve remotely).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.