Koozali.org: home of the SME Server
Obsolete Releases => SME 9.x Contribs => Topic started by: nicolatiana on May 07, 2019, 11:31:12 PM
-
I'd like to modify "Recycle Bin" name into ".Recycle Bin" to have the directory hidden in the same way I did/do with standard iBays.
The template fragment to be duplicated in template-custom and then expanded should be:
/etc/e-smith/templates/etc/smb.conf/shares/10recyclebin
The line to modify should be:
my $recycle = $share->prop('RecycleBinDir') || "Recycle Bin";
my $recycle = $share->prop('RecycleBinDir') || ".Recycle Bin";
purge-shares-recycle in cron.daily should be modified too:
my $dir = $share->prop('RecycleBinDir') || 'Recycle Bin';
my $dir = $share->prop('RecycleBinDir') || '.Recycle Bin';
Just to be confirmed if this is enough or other settings are stored in other places.
-
Hi, i'm also interested in the subject. (in fact change their names) for recycle bin's users too.
-
I did it and it's working fine.
You need also to change manually (it's not templated) purge script located in /etc/cron.daily
purge-shares-recycle
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# copyright (C) 2010 Firewall Services
# daniel@firewall-services.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
use esmith::AccountsDB;
use File::Find;
use File::stat;
my $a = esmith::AccountsDB->open_ro or die "Error opening accounts DB\n";
foreach my $share ($a->get_all_by_prop(type=>'share')){
my $key = $share->key;
my $recycle = $share->prop('RecycleBin') || 'disabled';
our $retention = $share->prop('RecycleBinRetention') || 'unlimited';
# Skip the share if recycle bin is disabled or if retention is not limited
next if (($recycle eq 'disabled') || ($retention eq 'unlimited'));
# Convert retention in seconds
$retention = 60*60*24*$retention;
my $dir = $share->prop('RecycleBinDir') || '.Recycle Bin';
# Skip if dir contains ./
next if $dir =~ m#(\./)#;
finddepth(\&remove, "/home/e-smith/files/shares/$key/files/$dir/");
}
sub remove{
# Remove files with last modification older than $retention
if ( -f ){
my $mtime = stat($_)->mtime;
(time() - $mtime > $retention) && unlink($_);
}
# Remove empty directories
elsif ( -d ){
(scalar <"$_/*">) || rmdir("$_");
}
}
-
It seems ok to rename witch "corbeille" and purge sharefolders with cron
But if i modify the share with the server-manager, it creates again a new recycle bin called recycled bin or .recycled bin ...
-
What kind of modifications did you: specifically concerning Trash ?
It seems template-custom is not considered.