hagridsbeard Posted April 28, 2009 Posted April 28, 2009 Long story condensing a go go... Kids comes in saying his quota is full. Checked his H drive (redirected via AD to a network share) and found a hidden RECYCLER folder full of all the stuff he'd studiously tried to delete to free up space. Did a test where he went to a room, deleted his stuff, went to another machine and recovered it so I know it's a fully functioning recyle bin. Now this is super, but... I have no idea how it's working. I thought it wasn't possible using XP and Server 2003? I've gone thorugh a process of elimination and took the profile out of the equation, leaving only the GPO settings. But other than Desktop (network share), Start Menu (network share) and Application Data (C:\Appdata) re-directions, I can't see what's making it work. Like I say, it's a good thing as it means no more 'can I get all my work back I just did this second and deleted it' problems, but it does mean my file server is rapidly filling up with RECYCLER folders in each users area. Any ideas... anyone?
dhicks Posted April 28, 2009 Posted April 28, 2009 Any ideas... anyone? A nightly, or maybe weekly, scheduled task that runs a script that simply deletes, or empties, all RECYCLER folders on the server? Frees up your disk space, but the pupil can still get their work back if they have an oops-didn't-mean-that moment. -- David Hicks
hagridsbeard Posted April 28, 2009 Author Posted April 28, 2009 I was thinking something like that. We have incremental backups each night (except a full on Friday) so I could run a cleanup script of all RECYCLER folders after the backup, meaning that students can restore their own work if they catch it during that day, or, we can pretty much get any work back at any time from the backup (restore the RECYCLER folder from the day they deleted it). Quite a good position to be in really, but still two questions: Any ideas of a simple script to do what we're suggesting and... Any ideas why has this suddenly started working (WSUS update maybe - at a stretch)
powdarrmonkey Posted April 28, 2009 Posted April 28, 2009 This is standard behaviour. You will find that if files are removed from the My Documents path, they are recycled, but if removed from a mapped drive they are destroyed immediately. I preserve the disk space by 'emptying' the recycle bin for the user with a logoff script (the deltree command is your friend, as long as you're nice to it). 1
srochford Posted April 28, 2009 Posted April 28, 2009 You've redirected "my documents" to a network share. By default, anything deleted from "my docs" goes in the recycle bin and that's still true even if it's now on a network share. I don't think this is well documented (and I may not have it completely right; I'm just writing from my experience) There's an equally poorly documented registry value which stops this behaviour; create a DWORD value called NukeOnDelete at the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket and set its value to 1 (0 or absent means files go in the bin) having the recycle bin is not necessarily a bad thing as long as your users know about it and you give them a way to get at the bin and empty it or get files back from it. If you want to script emptying it then something like this would work (put it in a batch file) d: cd \home for /d %%i in (*) do rd "%%i\recycler" /s /q This assumes that your user home folders are something like d:\home\user1; d:\home\user2 etc. If you have them a level further down then you could do: d: cd \home\year9 for /d %%i in (*) do rd "%%i\recycler" /s /q cd \home\year10 for /d %%i in (*) do rd "%%i\recycler" /s /q 1
hagridsbeard Posted April 28, 2009 Author Posted April 28, 2009 This is standard behaviour. You will find that if files are removed from the My Documents path, they are recycled, but if removed from a mapped drive they are destroyed immediately. I preserve the disk space by 'emptying' the recycle bin for the user with a logoff script (the deltree command is your friend, as long as you're nice to it). Think I'm getting you here, just tested and: A file deleted from 'My Computer - student on 'server\students$\student' ( H: )' won't go into the recyle bin A file deleted from 'My Documents' will and can be restored This kind of explains why when I was trying to eliminate profiles and GPO it was a bit erratic as sometimes I deleted via 'My Computer' and sometimes 'My Documents'. Ok, in that case a new healthy blast of questions: Why do they differ when they go to the same place? How can the My Computer drive be made to work the same way? And actually, why the hell am I working on this at this time anyway?
elsiegee40 Posted April 28, 2009 Posted April 28, 2009 The answer I think is to scrap the recycling bin completely and use volume shadow copy. Set up properly it'll hold a couple of weeks worth of backups of network and home drives... Admitting that the Previous Versions tab is on folder properties is up to you. It's my little secret ... the bit of magic Mrs G uses to recover work deleted in error (and to prove that pupil x couldn't possibly have saved her work at 12.25 before going to lunch last week ... Volume Shadow copies taken at 12.30pm and 7pm here!)
powdarrmonkey Posted April 28, 2009 Posted April 28, 2009 Think I'm getting you here, just tested and: A file deleted from 'My Computer - student on 'server\students$\student' ( H: )' won't go into the recyle bin A file deleted from 'My Documents' will and can be restored This kind of explains why when I was trying to eliminate profiles and GPO it was a bit erratic as sometimes I deleted via 'My Computer' and sometimes 'My Documents'. Yeh, I spent hours one day trying to convince myself I wasn't going mad, until I worked out what the difference was! Ok, in that case a new healthy blast of questions: Why do they differ when they go to the same place? How can the My Computer drive be made to work the same way? Well, although the storage location is identical, the My * folders have always been treated differently and I think it's just The Way Things Are. I did try and make a mapped drive behave the same using the BitBucket settings in the registry, but it didn't work very well and I didn't have much time to spare for it, so we left it as it was. I just emptied the bin during logoff so that, as long as the circumstances were right, users at least got a second chance at their deleted documents during that session. And actually, why the hell am I working on this at this time anyway? As to that, I can't help you 1
hagridsbeard Posted April 28, 2009 Author Posted April 28, 2009 The answer I think is to scrap the recycling bin completely and use volume shadow copy. Set up properly it'll hold a couple of weeks worth of backups of network and home drives... Admitting that the Previous Versions tab is on folder properties is up to you. It's my little secret ... the bit of magic Mrs G uses to recover work deleted in error (and to prove that pupil x couldn't possibly have saved her work at 12.25 before going to lunch last week ... Volume Shadow copies taken at 12.30pm and 7pm here!) Hmm, I dunno. Considering what the others guys have mentioned, I think I'll have a go at hiding the mapped drive from 'My Computer', that way, they can only ever delete from 'My Documents' and always have the option of immediate recovery. Add that to the backup and cleanup method I banded around earlier, and I think I've got a pretty damn flawless recovery setup. Weird that they work so differently even though both locations are doing exactly the same re-direction. Windows is a crazy beast.
powdarrmonkey Posted April 28, 2009 Posted April 28, 2009 Hmm, I dunno. Considering what the others guys have mentioned, I think I'll have a go at hiding the mapped drive from 'My Computer', that way, they can only ever delete from 'My Documents' and always have the option of immediate recovery. That might cause more problems than it solves. Some poor software, for example, can't deal with redirected folders or UNC paths and insists on saving to a mapped drive (in some strange delusion that it's a physical drive). You'll have to give it a go and see what doesn't work. You might be able to do away with home drives altogether if you can configure folder redirection with a %USERNAME% variable and you have your share laid out in a sensible way. I don't know, I've never tried it.
hagridsbeard Posted April 28, 2009 Author Posted April 28, 2009 That might cause more problems than it solves. Some poor software, for example, can't deal with redirected folders or UNC paths and insists on saving to a mapped drive (in some strange delusion that it's a physical drive). You'll have to give it a go and see what doesn't work. You might be able to do away with home drives altogether if you can configure folder redirection with a %USERNAME% variable and you have your share laid out in a sensible way. I don't know, I've never tried it. All food for thought. At least I've got a better idea why it's happening now, like you said, I was going round in circles trying to understand what was going on and it was driving me mad. Think for now I'll just clear the RECYCLERs periodically and leave it up to the more aware students to recover files that they delete. Cheers for all your advice/pointers, at least I'm not completely crazy.
leco Posted April 28, 2009 Posted April 28, 2009 Cheers for all your advice/pointers, at least I'm not completely crazy. Only a bit crazy - like the rest of us - for working on it at this time of night;)
dhicks Posted April 28, 2009 Posted April 28, 2009 The answer I think is to scrap the recycling bin completely and use volume shadow copy. Needs to be in there overnight (or whenever your backup job runs) for the file to get in to the backup copy, which still leaves plenty of opportunity for pupils to delete stuff they've been working on all lesson/day. Could make your deleting script check the modification date of each item in the RECYCLER folder and only delete stuff that's more than or equal to two days old. -- David Hicks
ascott2 Posted April 29, 2009 Posted April 29, 2009 (edited) I haven't teste this yet but, as far as I am aware, if you do not want this to happen you can enable in group policy to bypass the Recycle bin and delete files. This will disable the RECYCLER folder being created in the first place. User Configuration > Administrative Templates > Windows Components >Windows Explorer > Do not move deleted files to the Recycle Bin Edited April 29, 2009 by ascott2 missed out Windows Components
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now