Changes

From SME Server
Jump to navigationJump to search
844 bytes added ,  12:43, 13 January 2019
m
Line 1: Line 1:  +
{{Languages}}
 
===Problem===
 
===Problem===
   Line 12: Line 13:  
  db accounts setprop ibayname KeepVersions enabled  
 
  db accounts setprop ibayname KeepVersions enabled  
 
  signal-event ibay-modify ibayname
 
  signal-event ibay-modify ibayname
 +
 +
The first property enables the Recycle Bin feature. The second property KeepVersions ensures that when a file is deleted with the same name as one that was previously deleted the latest deleted file will be called “Copy #x of filename”.
    
=== Enable Recycle Bin for users ===
 
=== Enable Recycle Bin for users ===
Line 44: Line 47:  
=== Automatic Cleaning Of Recycle Bin Content ===
 
=== Automatic Cleaning Of Recycle Bin Content ===
   −
The simple script below can be used to clean out the various Recycle Bins on a regular basis. Note that this script is setup to use the last accessed file attribute to selectively deletes files after they have been in the Recycle Bin for 30 days.
+
The simple script below can be used to clean out the various Recycle Bins on a regular basis.  
 +
 
 +
Note that this script is setup to use the last changed file attribute to selectively deletes files after they have been in the Recycle Bin for 30 days.
    
Setup the script to run either daily or weekly from cron.
 
Setup the script to run either daily or weekly from cron.
 +
{{Tip box |msg= If after running the script you receive empty notification emails and you've checked the date flags of the files in the recycle bin and know that they should be removed, try changing the '-ctime' parameter to '-mtime'. [[bugzilla:7596]]
 +
You can check the output by running this at the command prompt to see if any files are now being flagged for removal (you can adjust the number of days as you wish):
    +
find /home/e-smith/files/users/*/home/Recycle\ Bin/* -type f -mtime +30 -print }}
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
 +
 +
# ensure finds includes hidden files in the Recycle Bins
 +
shopt -s dotglob
    
echo "+------------------------------------------------------------------------------+"
 
echo "+------------------------------------------------------------------------------+"
Line 55: Line 66:  
echo "+------------------------------------------------------------------------------+"
 
echo "+------------------------------------------------------------------------------+"
   −
URF=$(find /home/e-smith/files/users/*/home/Recycle\ Bin/* -type f -atime +30)
+
URF=$(find /home/e-smith/files/users/*/home/Recycle\ Bin/* -type f -ctime +30)
 
if [ "$URF" !=  "" ]
 
if [ "$URF" !=  "" ]
 
then
 
then
Line 71: Line 82:  
echo "+------------------------------------------------------------------------------+"
 
echo "+------------------------------------------------------------------------------+"
   −
IRF=$(find /home/e-smith/files/ibays/*/files/Recycle\ Bin/* -type f -atime +30)
+
IRF=$(find /home/e-smith/files/ibays/*/files/Recycle\ Bin/* -type f -ctime +30)
 
if [ "$IRF" !=  "" ]
 
if [ "$IRF" !=  "" ]
 
then
 
then
Line 136: Line 147:  
Modifying this line:
 
Modifying this line:
   −
  $vfs->{recycle}->{repository} = "Recycle Bin";
+
  $ibay_vfs->{recycle}->{repository} = "Recycle Bin";
    
to whatever you like for a name:
 
to whatever you like for a name:
   −
  $vfs->{recycle}->{repository} = "Add your name here";
+
  $ibay_vfs->{recycle}->{repository} = "Add your name here";
 +
{{Tip box|You can make the recycle bin hidden by adding a dot as a first character of the recycle bin name}}
    
</li><li>Now let the server take the necessary actions to have the changes reflected for all ibays (replace <nowiki><ibayname></nowiki> with the ibayname):
 
</li><li>Now let the server take the necessary actions to have the changes reflected for all ibays (replace <nowiki><ibayname></nowiki> with the ibayname):
Line 147: Line 159:  
</li></ol>
 
</li></ol>
   −
{{Tip box|You can make the recycle bin hidden by adding a dot as a first character of the recycle bin name}}
+
 
 
----
 
----
 
[[Category: Howto]]
 
[[Category: Howto]]
 
[[Category:Administration:File and Directory Access]]
 
[[Category:Administration:File and Directory Access]]
3,054

edits

Navigation menu