One problem with using files on the server is that if you delete it you are not able to get it back.
I just found the recycle option you can put onto a share (vfs objects = recycle). I think this would be a great option to make as a checkbox. You could have .recycle accessible from the dashboard -> shares to reinstate a file/s or directory/s. Using a cut down version of PHP Navigator or a HTML version of Windows Recycle Bin with an option to restore or permanently delete.
But reading the forum topics below, I don't know the best way to implement a recycle bin. If it saves every edit, it could be like Apple's time machine thing.
Greyhole Attic and full hdd
Greyhole Attic Question
Samba Recycle Bins
Having a recycling bin would be a great feature!
#1 Updated by Zeiva almost 11 years ago
Greyhole has its Attic feature which acts like a recycle bin for all the pooled shares.
When you delete something from a share pooled with greyhole the files are not actually deleted, just moved to the greyhole attic. Unless manually emptied the attic will continue to grow untill all the drives in the storage pool are full!
One way of emptying the attic is by typing the following command as root: greyhole --empty-attic
The problem with the above method is that it requires user interaction with the terminal and does not let the user easily browse the attic for files they might want to keep before wiping it.
The solution is to have Amahi create a share named "Greyhole Recycle Bin" (Case sensitive) with the checkbox for Storage Pooling already checked. This should be done automatically as soon as Storage Pooling is enabled for any other share to ensure it can track all future deletions. The key parts here is the name of the share and the checkbox, with these in place greyhole will automatically know to use it as a recycle bin.
For existing users of Greyhole there are a few extra steps that need to be taken before pushing this feature to users. Greyhole will NOT add previously deleted files from the attic into the newly created recycle bin share. Those files will remain on the drives and take space unless cleaned out manually by the command greyhole --empty-attic. This command can run as part of the update that adds the feature, ensuring a clean slate. Another way which would be preferable is to somehow warn/inform the users of the greyhole --empty-attic command and why it is necessary so they get a chance to bring back files before it runs.
To inform the user about the greyhole --empty-attic command there could be a notice/warning in the WebGUI that takes the user to a page which informs them what the command does, how to recover previously deleted files in case there is something they want back and finally a button that runs the command. This should ensure the newly created recycle bin share can start with a clean slate while also giving the user a chance to rescue their data.
#3 Updated by cpg almost 11 years ago
- Status changed from New to Feedback
- Assignee set to gboudreau
gboudreau - any known interactions with Greyhole?
or is it all known to be good?
i vaguely recall there was something related to greyhole here, but i do not really recall if it was good or bad.
sonofmof, yes, you can try by adding
vfs objects = recycle
you can also add any one of these (which ones should we choose?)
recycle:keeptree = yes recycle:versions = yes recycle:touch = yes recycle:exclude = ?~$*,~$*,*.tmp,index*.pl,index*.htm*,*.temp,*.TMP recycle:exclude_dir= /tmp,/temp,/cache recycle:repository = .recycle/.recycle.%u recycle:noversions = *.doc,*.xls,*.ppt
to the extra options of a share. can you try it and see if this feature is good?
i am not sure how someone would access the recycling bin when enabled, though. other than perhaps creating a share to it?
#4 Updated by sonofmof almost 11 years ago
if i add the first vfs line, what should i see ?
i like the idea about of the recycle bin being given a share and therefore viewable. i think this would make sense to most "non technical" users for whom the re-cycle bin is just where deleted files go. its also understood that deleting from the recycle bin would permenantly delete the files, like a greyhole attic delete does now.
what do the other lines mean ?
#5 Updated by arnonm almost 11 years ago
You can access the Recycle bin with a share. GH allows a single recycle for all shares, or seperate ones.
Sticking with the simple solution of one.
1. A directory should be created for this. In may case, I used /var/hda/files/Trash as I was using Amahi
2. Edit smb.conf and create an entry for the Share. The Share name MUST use one of the names above: Greyhole Attic, Greyhole Trash, or Greyhole Recycle Bin (case sensitive) and needs to include the dfree command and vfs objects. an example:
comment = Trash
path = /var/hda/files/trash
writeable = yes
browesable = yes
force create mode = 0664
directory mask = 0775
dfree command = /usr/bin/greyhole-dfree
vfs ojbects = greyhole
restart Samba: services smb restart
edit /etc/greyhole.conf and ensure
delete_moves_to_attic = true
Delete a file in one of your greyhole shares, and it will appear in the Trash mount
However, Guillaume has commented that "On Amahi, that share can and should be created like any other shares: using the Amahi Dashboard, Setup > Shares page. You just need to use the proper share name, and make sure the "Uses pool" option is selected for your share. Amahi takes care of the rest."
I still think an option should exist for GH to turn on the Recycle and Amahi creates is.
Also available in: Atom