D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-323 => Topic started by: jrbilodeau on August 29, 2008, 06:27:48 AM

Title: Adding recycle bin
Post by: jrbilodeau on August 29, 2008, 06:27:48 AM
Here is a feature that i would like to see added as well as how to add it. i would like to have a recycle bin which is possible to do with samba

under the [ global ] setion of the smb.conf file add the following lines

vfs object = recycle
recycle:repository = .recycle
recycle:directory_mode = 0777
recycle:subdir_mode = 0777
recycle:keeptree = Yes
recycle:versions = Yes
recycle:touch = No
recycle:touch_mtime = No
recycle:maxsize = 0
recycle:exclude = *.tmp,*.temp, ~$*, *.~??
recycle:exclude_dir = /.recycle

this will create a .recycle directory in the root of the Volume as soon as something is delected. so if you have 2 Volumes like i do, you would have one recycle bin on Volume_1 and one on Volume_2

this addition would be greatly appreciate by many users i belive
Title: Re: Adding recycle bin
Post by: coolspot on September 04, 2008, 10:26:47 PM
Yes, out of the box support for a recycle bin would be nice. Thanks to your article, I was able to put it in via fun_plug, but for many users, I'm sure that would be beyond their comfort level.
Title: Re: Adding recycle bin
Post by: jrbilodeau on September 05, 2008, 06:44:40 AM
Ya, after having accidentally deleted a few files, i decided to look into the possibility of having a recycle bin. i have seen many posts about people that lost of deleted files, and i think that this is a great way to avoid that for most people.
Title: Re: Adding recycle bin
Post by: bigclaw on September 05, 2008, 06:48:46 AM
Will these deleted files show up in the Windows recycle bin (on the desktop), or do you have to navigate to the said directory to permanently delete them?

Thanks.
Title: Re: Adding recycle bin
Post by: coolspot on September 06, 2008, 12:56:24 AM
Will these deleted files show up in the Windows recycle bin (on the desktop), or do you have to navigate to the said directory to permanently delete them?

It's a separate folder which you need to manually clear out.

Unfortunately Windows does not support a network recycle bin, so I do not think there will be a way to support it. The option provided by jrbilodeau is as good as it gets  :)
Title: Re: Adding recycle bin
Post by: jrbilodeau on September 09, 2008, 05:50:01 AM
Ya it creates a folder called .recycle in the root of the drive
Title: Re: Adding recycle bin
Post by: Lucid on September 10, 2008, 10:02:50 AM
soudns good to me. If only I could understand the instructions...
Title: Re: Adding recycle bin
Post by: jrbilodeau on September 24, 2008, 06:56:49 AM
the smb.conf file is hidden to a normal user. you need telnet access to be able to see it.
Title: Re: Adding recycle bin
Post by: Lucid on September 24, 2008, 08:30:14 AM
Of course. I just read the post again. Thanks for the info. I assume that  in order to permanently delete the files one must navigate to the recycle bin DIR and manually delete it right?

TIA
Title: Re: Adding recycle bin
Post by: jrbilodeau on September 25, 2008, 07:01:51 AM
that is correct. once you delete it from the recycle bin it gone. also just to clarify, when you delete it doesn't ask if you want it go to the recycle bin, it just sends it there.
Title: Re: Adding recycle bin
Post by: Lucid on September 25, 2008, 07:12:50 AM
Very helpful. Karma coming your way!
Title: Re: Adding recycle bin
Post by: puterboy on October 07, 2008, 05:47:11 PM
the smb.conf file is hidden to a normal user. you need telnet access to be able to see it.

Just a clarification that may not be obvious to the new user. If you just write to /etc/samba/smb.conf then the changes will be lost with each power-down/reboot.

You need to write the changes to the version stored in flash (which if done improperly could make your machine inoperable. If you are using Fonz's fun_plug you may want to look at /ffp/sbin/store-passwd.sh for an example of how to write (relatively safely) to the flash memory).

I haven't looked at this extensively, but it appears based on a quick look at /etc/rc.sh, that to make the changes permanent you will want to first edit /etc/samba/smb.default and the write those changes to the corresponding files in /dev/mtdblock0 (and maybe also /dev/mtdblock1) -- look at either /etc/rc.sh or /ffp/sbin/store-passwd.sh for examples on how to do this.

I believe that what happens is that the compiled program /usr/bin/smbcom (which is run on boot from rc.sh) concatenates samba.default (which contains the system-level config parameters) with /mnt/HD_a4/.systemfile/.smb.ses [note may not be HD_a4 on your system] (which contains the user/group samba share details). The concatenated result (minus any commented lines) is then written out to /etc/samba/smb.conf. Then rc.sh launched the smbd/nmbd daemons.

The bottom line is that if you want the changes to stick, you will likely need to make changes to the flash version of smb.default. Also, if you change the smb.default file then the changes won't take affect until you reboot or alternatively you could probably kill the smbd/nmbd daemons, re-run smbcom and then restart the daemons. Similarly, if you edit /etc/samba/smb.conf directly the changes won't take effect until you kill smb/nmbd and then restart them (or alternatively you could probably just send a SIGHUP to the smbd process)

AGAIN DISCLAIMER - I CAN'T PROMISE THIS WILL WORK, I AM ONLY GIVING SOME POINTERS. THIS PROBABLY WILL VOID YOUR WARRANTY AND IT COULD BRICK YOUR MACHINE IF I AM WRONG OR IF YOU MAKE A MISTAKE.
Title: Re: Adding recycle bin
Post by: Lucid on October 07, 2008, 06:46:52 PM
Nice reply. I use this for my work and so I'll pass until Dlink adds this feature.

Thanks for the warning!!
Title: Re: Adding recycle bin
Post by: s5678 on March 10, 2009, 06:18:25 PM
Removed.
Title: Re: Adding recycle bin
Post by: D-Link Multimedia on March 10, 2009, 10:43:01 PM
Please read the forum rules BEFORE posting.

That being said, it is not as simple to add this feature as you may believe. Unfortunately we have network access per username which means that if you have one single recycle bin and multiple users then ANYONE can see ANYONE elses deleted files if they did not empty the recycle bin in this scenario. If/when we implement it will be done in the correct fashion.
Title: Re: Adding recycle bin
Post by: mig on March 10, 2009, 11:45:01 PM
Unfortunately we have network access per username...
That's not exactly the way I see it.  IMHO, it seem to me, that D-Link has implemented network access per 'share'.  I believe, it would be a tremendous improvement in usability for the DNS-323, if D-Link could actually implement access per username.

Of course, this doesn't solve the common recycle bin issue you brought up, but access per username sure would be great!
Title: Re: Adding recycle bin
Post by: D-Link Multimedia on March 11, 2009, 12:51:35 AM
You are correct, misuse of wording on that. It is per share. Same issue still applys :).
Title: Re: Adding recycle bin
Post by: s5678 on March 18, 2009, 10:21:59 PM
Sorry.  Just trying to help. 

FYI, A common recycle bin isn't a problem for home networks or most small office networks.  You have a good product here, please don't go the mickeysoft route of thinking that you know best and end-users are idiots.  The recycle bin can be configured for each use (just google samba config), I (and most others googling this issue) just didn't want to do it that way. 

Again, sorrry, it's a shame really, just trying to help.
Title: Re: Adding recycle bin
Post by: Lucid on May 16, 2009, 08:08:52 PM
Of course that does make sense.
Title: Re: Adding recycle bin
Post by: nightshocker on June 06, 2009, 07:08:38 AM
you people and your recycle bin. well if you do add it dlink please add another option to disable it. i find the windows recycle bin annoying, that is why i disable it in windows. if you dont want something deleted dont delete it. simple right.   (yes i never delete anything i do not want)
Title: Re: Adding recycle bin
Post by: Lucid on June 06, 2009, 07:26:12 AM
you people and your recycle bin. well if you do add it dlink please add another option to disable it. i find the windows recycle bin annoying, that is why i disable it in windows. if you don't want something deleted don't delete it. simple right.   (yes i never delete anything i do not want)

Take it easy...there is a reason why OS's have this and it works. If you want a disable option I'll bump that.

Keeping our client files on the NAS is the reason why we own the DNS-323. We have to keep them for 7 years and aren't he type of business that will benefit from a full on enterprise networking solution but we are high  paced never the less. Some of the users here use the NAS for more than storing warez and **** that can suffer deletion. If one of our employees deletes a file / folder and we don't have a paper backup we are screwed should we be audited. I'd like to go fully paperless but we need a recycling bin to prevent the accidental deletions that may or may not occur.

G'night Shocker

 
Title: Re: Adding recycle bin
Post by: wrlee on June 09, 2009, 12:27:18 PM
Just a clarification that may not be obvious to the new user. If you just write to /etc/samba/smb.conf then the changes will be lost with each power-down/reboot.
If I remember correctly, I was able to (1) modify the smb.conf file and (2) save add'l Samba changes via the configuration web page. The latter seemed to cause the edits I made in (1) stick. I did not try to add the recycle bin, explicitly, but other settings that were not available on the web page did stick (i.e., changing the default share names).
Title: Re: Adding recycle bin
Post by: rkaye on July 22, 2009, 10:07:42 AM
while it would be a welcome feature; you can do this (recycle bin) more-or-less already.

-move files instead of deleting them
-set permissions for users to read-only, except for an admin (if you have family members that are a little too quick with the delete key)
Title: Re: Adding recycle bin
Post by: Lucid on July 22, 2009, 02:56:44 PM
That's ridiculous...."A" for effort though! Keep em coming!