NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
JMehring
Sep 29, 2013Apprentice
Can 'Recycle Bin' be enabled for CIFS and OS 6.1.2 on a 314?
The older 4.x version of the OS allowed a Recycle Bin when using CIFS. Is this possible on the new OS 6.1.2?
I noticed a recycle.conf file in '/data/._share/media' containing:
I noticed a recycle.conf file in '/data/._share/media' containing:
25000,0
22 Replies
Replies have been turned off for this discussion
- evan2NETGEAR ExpertThere is not Recycle Bin on 6.1.2 which utilize btrfs' snapshot feature so that user can revert any point of time from snapshots.
- DeeCee521AspirantHmmm......I started out on 6.0 and I did migrate data from an Ultra 4+, which had a recycle bin. It still seems to be functioning even though I have upgraded up to and including 6.1.3. Now both recycle bin and snapshot have been difficult to backup on an older nV+. I think I have been able to configure both / and, one or non using the web interface but it silk may not be functioning correctly.
Sent from my GT-N8000 using Tapatalk 4 - JMehringApprenticeI did get Recycle Bin working on 6.1.4, but had to manually edit some configuration files to make it work.
If anyone is interested, I will tell you how I did it.
EDIT.
The reason I want Recycle Bin and not use snapshots to restore previous versions is because I don't want the files actually deleted; I still want them accessible.
I use Plex Media Server to manage my content. When I am finished watching a tvshow, etc I delete the show and then it is moved into Recycle Bin. Other family members have the Recycle Bin as a source for their media sections. That way even though I deleted the file, it is still available for others to view. Then every few months I go ahead and permanently delete the media files in Recycle Bin that have been viewed by others. - davexyzAspirantHi JMehring
I also would like to have Recycle Bin rather than snapshot on 6.1.4 can you post info on what to do step by step
That would be great - JMehringApprenticeWhat I did was created this File:
/etc/frontview/samba/addons/addons.conf
-rw-r--r-- 1 admin admin 556 Nov 6 00:43 addons.conf
Then I edited it to include 2 of my existing shares that I want to have 'Recycle Bin' bin enabled:
[bitcasa]
vfs objects = recycle
recycle:repository = Recycle Bin
recycle:keeptree = yes
recycle:versions = no
[media]
vfs objects = recycle
recycle:repository = Recycle Bin
recycle:keeptree = yes
recycle:versions = no
Now you need to reload the config file. The only way I could figure out how to do this was go to the frontview web interface -> Shares and edit one of your current shares changing something so when you press OK, it will reload config file (I just kept toggling ftp on and off when testing).
Then, just run:
testparm
It should list all your shares and show the recycle: parameters for the sections you wanted.
Note, I use the name 'Recycle Bin', but you could choose another like '.trash' - DeeCee521AspirantI just realized that my recycle bins are disappearing one by one. I have the snapshots. It would be nice if you could choose at set up.
Swyped from my Galaxy Nexus using Tapatalk 4 - davexyzAspirantThanks JMehring
I will set this up in my NAS - JMehringApprentice
davexyz wrote: Thanks JMehring
I will set this up in my NAS
Your Welcome!
Let me know if you have any issues since it was some time ago I did this.
Just a few other notes:
- only add the extra configuration options per section I listed in post above as they will get appended to original sections
- I am not sure if the old 'Recycle Bin' script that automatically deletes items in 'Recycle Bin' is still hanging around in OS6. If it is be warned that items may start to disappear if you do not have the script configured properly. You can always name 'Recycle Bin' to something like .trash if you are concerned about this.
- If you want items in 'Recycle Bin' to be automatically deleted after some time, I will provide provide a modified version of the original OS4 'clean_recycle_bins' script you can use. The original ReadyNAS one never worked correct for me and ended up deleteing things sooner than I wanted so I fixed it to work the way I expected it. You would need to add it to a cron job.
- If you play are with the clean_recycle_bins' script, I suggest you make a snap shot of the share first and keep it for a while (at least a few reboots and a few days' to make sure things are not being deleted you don't want to have deleted; also maybe make a shorter test of 5 days to test initially. BE WARNED is you modify 'clean_recycle_bins' even more and are using it with a cron job, the older version will still be in spool, so make sure its removed and using your fresh version. I got stung by this when I upgraded firmware on OS4 and since their version was broken, it always ended up cleaning out my 'Recycle Bin' early if I was not careful.
- IMPORTANT. You never know if any custom modifications you make will survive an upgrade and most likely will not survive a factory reset. So I personally create a backup of every file I manually configure, add, install, etc in a share that is backed up so I can easily replicate my changes down the road. I will show example tree layout below. This allows me to quickly see which files need to be modified, changed etc if I do a factory reset and I always check after a firmware upgrade:
/data/backup/00_ReadyNAS_OS6/NOTES.txt
/data/backup/00_ReadyNAS_OS6/00_THINGS_TO_RESTORE_ON_UPGRADING/bitcasa_0.9.6.99_amd64.deb
/data/backup/00_ReadyNAS_OS6/00_THINGS_TO_RESTORE_ON_UPGRADING/restore_apt_packages.sh
/data/backup/00_ReadyNAS_OS6/etc/frontview/samba/addons/addons.conf
/data/backup/00_ReadyNAS_OS6//etc/frontview/recycle.conf
/data/backup/00_ReadyNAS_OS6/frontview/bin/clean_recycle_bins
/data/backup/00_ReadyNAS_OS6/root
/data/backup/00_ReadyNAS_OS6/etc/init.d/bitcasa
/data/backup/00_ReadyNAS_OS6/etc/init.d/Xvfb
/data/backup/00_ReadyNAS_OS6/etc/passwd
/data/backup/00_ReadyNAS_OS6/etc/group
/data/backup/00_ReadyNAS_OS6/apps/<BACKUP of all apps in /apps directory>
Here is the modified 'clean_recycle_bins' script that used to live in '/frontview/bin/clean_recycle_bins' on OS4:
#!/usr/bin/perl
#-------------------------------------------------------------------------
# Copyright 2007, NETGEAR
# All rights reserved.
#-------------------------------------------------------------------------
use lib qw( /frontview/lib );
use Frontview;
my $fv = new Frontview;
$fv->Account_get_info();
$fv->Service_get_info();
open(IN, "/etc/frontview/recycle.conf") || exit;
my = <IN>;
close(IN);
#if( $fv->{Service}{USER_HOME_DIRECTORY} &&
# $fv->{Service}{USER_HOME_DIRECTORY_RECYCLE} )
#{
# my $path;
# my $recycle_max_days = $fv->{Service}{USER_HOME_DIRECTORY_RECYCLE_MAX_DAYS};
# $recycle_max_days = $HOME_RECYCLE_AGE_LIMIT if( !$recycle_max_days );
# my $recycle_max_size = $fv->{Service}{USER_HOME_DIRECTORY_RECYCLE_MAX_SIZE};
# $recycle_max_size = $HOME_RECYCLE_MB_LIMIT if( !$recycle_max_size );
#
# printf("Max Days: %s\n", $recycle_max_days);
# printf("Max Size: %s\n", $recycle_max_size);
# printf("dirlist: \n\n");
#
# foreach my $user( sort keys %{ $fv->{Account}{user} } )
# {
# printf("user: $user\n");
# if( -d "$fv->{Account}{user}{$user}{home}/Recycle Bin" )
# {
# $path = $fv->{Account}{user}{$user}{home};
# printf("Path: %s\n-----------------------------------------------\n", $path);
# push , "$user!!$path!!$recycle_max_size!!$recycle_max_days";
# }
# }
#}
printf("dirlist: \n\n");
chomp;
printf("dirlist: \n\n");
foreach ()
{
chomp;
my ($share, $path, $mb_limit, $age_limit) = split('!!');
printf("Share: %s\n", $share);
if( $age_limit )
{
printf("Age Limit: %s\n", $age_limit);
system("find '$path/Recycle Bin' -type f -ctime +$age_limit -exec rm -rf {} \\; &>/dev/null");
}
if( $mb_limit )
{
printf("MB Limit: %s\n", $mb_limit);
my $recycle_mb = `du -sm '$path/Recycle Bin' 2>/dev/null`; chomp $recycle_mb;
if( $recycle_mb > $mb_limit )
{
my %files;
open(FIND, "find '$path/Recycle Bin' -type f -printf '%p!=!=%C@!=!=%s\n' |");
while(<FIND>)
{
chomp;
my ($name, $time, $size) = split('!=!=');
while( exists $files{$time} )
{
++$time;
}
$files{$time}{name} = $name;
$files{$time}{size} = $size;
}
close(FIND);
my $total_size = 0;
my $byte_limit = ($mb_limit * 1024 * 1024);
foreach my $time (reverse sort keys %files)
{
$total_size = ($total_size + $files{$time}{size});
if( $total_size > $byte_limit )
{
unlink("$files{$time}{name}") or system("rm -f \'$files{$time}{name}\'");
}
}
}
}
# Do a reverse sort so we can rmdir child directories before the parents.
open(FIND, "find '$path/Recycle Bin' -type d 2>/dev/null | sort -r |");
while(<FIND>)
{
chomp;
rmdir;
}
close(FIND);
}
close(IN);
And here is an example 'recycle.conf' file that used to live in '/etc/frontview/recycle.conf' on OS4. This example cleans out the 'Recycle Bin' in the share 'media' after stuff is over 360 days old and in 'media-other' after files are over 180 days old and will allow the 'Recycle Bin' to grow to any size.
media!!/c/media!!0!!360
media-other!!/c/media-other!!0!!180 - davexyzAspirantWOW
You have looked at this
I have "installed" the Recycle Bin in my Nas Just what I wanted . I have simple requirements for my NAS and snapshots were not necessarily the best option for me. It even works on attached usb drives. This is the way I use my NV+ V1 and NV+V2.
Brilliant
Thanks once again for this - prix57GuideHello can this recycle bin also be added on a RN 104?
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!