+ Post New Thread
Results 1 to 11 of 11
Scripts Thread, Delete your old files or I will in Coding and Web Development; Dear All, Does anyone have a script that I can point at a named directory and it will delete any ...
  1. #1
    Geek_of_HeathMount's Avatar
    Join Date
    May 2009
    Location
    Biggleswade
    Posts
    109
    Thank Post
    21
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Delete your old files or I will

    Dear All,
    Does anyone have a script that I can point at a named directory and it will delete any file that has not been accessed since dd/mm/yyyy

    All the staff at my school are hoarders and they do insist on keeping every photo, you tube clip and document they have ever produced. I have been threatening to do this for ages but they have not listened so now it's time for action.

    Thanks in advance

    Ian

  2. IDG Tech News

  3. #2

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    The Office
    Posts
    5,434
    Thank Post
    236
    Thanked 696 Times in 629 Posts
    Rep Power
    226
    I did it with a simple search all things last edited before 4 years ago (found around 80gb) then moved it all to another server and nobody notices bar 1 person)

  4. #3


    Join Date
    Sep 2007
    Location
    UK
    Posts
    3,658
    Thank Post
    782
    Thanked 503 Times in 332 Posts
    Rep Power
    292
    I have issued countless warnings and been told "Oh I need those files!

    I have dvds goinf back years with stuff I have moved and I have never, ever been asked to resurrect anything.

  5. #4
    DaveMurphy's Avatar
    Join Date
    Aug 2009
    Location
    Rochdale / Middleton
    Posts
    177
    Thank Post
    6
    Thanked 8 Times in 7 Posts
    Rep Power
    8
    Allocate 500mb to their account and if / when they fill it they have to get rid of old stuff themselves to save most recent work... alternatively get them to use Live@EDU Skydrive.

  6. #5

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    The Office
    Posts
    5,434
    Thank Post
    236
    Thanked 696 Times in 629 Posts
    Rep Power
    226
    Quote Originally Posted by DaveMurphy View Post
    Allocate 500mb to their account and if / when they fill it they have to get rid of old stuff themselves to save most recent work... alternatively get them to use Live@EDU Skydrive.
    not that simple - some of our staff geniunly need say 4/5gb space which is fine by me aslong as 1. its proper work, 2. its not full of itunes collection 3. its not full of videos (we have custom made web based video player for this) they are allowed videos on there which are not more then a week that they have not managed to upload yet.

    oh and 4. slt give me funding for my new shiny File Servers next year

  7. #6

    Join Date
    Dec 2005
    Location
    East Sussex
    Posts
    2,591
    Thank Post
    135
    Thanked 225 Times in 175 Posts
    Rep Power
    95
    Quote Originally Posted by glennda View Post
    I did it with a simple search all things last edited before 4 years ago (found around 80gb) then moved it all to another server and nobody notices bar 1 person)
    I would say this or laserblazers idea. Someone is bound to need that 1 file that no one else in the world has a copy of 6 months down the line.

  8. #7

    witch's Avatar
    Join Date
    Nov 2005
    Location
    Dorset
    Posts
    6,798
    Thank Post
    432
    Thanked 1,079 Times in 787 Posts
    Rep Power
    356
    Every now and again I burn to DVD all the stuff older than 3 years and then delete it off the server. Noone has ever moaned and, like laserblazer, I have a pile of DVDs nobody even knows exist

  9. #8
    chrisredfield93's Avatar
    Join Date
    Feb 2009
    Location
    Wales
    Posts
    211
    Thank Post
    88
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    just my opuion hre wouldnt be better to turn an unused workstation to a server, and then house all the unused files on that clear the duplicates and then map the driveto your main server and then allow all them to have a shortcut to the file and only apply a script to copy it back in when it get accessed and then sorcut agian after few months of not acess

    this prob complex but with computer world ever involonmg sure this can be done

  10. #9

    jinnantonnixx's Avatar
    Join Date
    Mar 2011
    Location
    In the Calamatorium.
    Posts
    895
    Thank Post
    38
    Thanked 171 Times in 128 Posts
    Rep Power
    111
    Good old Robocopy has a option to move files based on access date.
    Robocopy

    /MAXAGE:n : MAXimum file AGE - exclude files older than n days/date.
    /MINAGE:n : MINimum file AGE - exclude files newer than n days/date.
    (If n < 1900 then n = no of days, else n = YYYYMMDD date).

    /MAX:n : MAXimum file size - exclude files bigger than n bytes.
    /MIN:n : MINimum file size - exclude files smaller than n bytes.
    /MAXLAD:n : MAXimum Last Access Date - exclude files unused since n.
    /MINLAD:n : MINimum Last Access Date - exclude files used since n.
    (If n < 1900 then n = n days, else n = YYYYMMDD date).

  11. #10

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    The Office
    Posts
    5,434
    Thank Post
    236
    Thanked 696 Times in 629 Posts
    Rep Power
    226
    one thing about doing it with a search is you can look at file paths - you can the look to see if there is a whole load of data which is stored say in the SLT folder and you don't think it should be moved you can avoid - some with things like pastoral records etc

  12. #11


    Join Date
    Jan 2006
    Posts
    6,457
    Thank Post
    324
    Thanked 740 Times in 557 Posts
    Rep Power
    201
    Quote Originally Posted by chrisredfield93 View Post
    just my opuion hre wouldnt be better to turn an unused workstation to a server, and then house all the unused files on that clear the duplicates and then map the driveto your main server and then allow all them to have a shortcut to the file and only apply a script to copy it back in when it get accessed and then sorcut agian after few months of not acess

    this prob complex but with computer world ever involonmg sure this can be done
    Actually not a bad idea at all. Assuming you didn't run any regular antivirus or backup on the temporary server (that would distort the access time) You could run a simple weekly script that moves them. using cygwin on windows or any other nix it would be a cron job like:
    Code:
     find /sharepath/ -atime +7 -print0 | xargs -0 -I {} mv {} /new/server
    where /new/server is a iscsi/smb/nfs share to the actual server

SHARE:
+ Post New Thread

Similar Threads

  1. What to do with your old crt's
    By drjturner in forum General Chat
    Replies: 10
    Last Post: 9th August 2007, 05:41 PM
  2. When does your school suspend or expel a pupil?
    By pete in forum School ICT Policies
    Replies: 8
    Last Post: 29th November 2006, 01:43 PM
  3. Circumvent your countries censorship...or schools?
    By mrforgetful in forum Jokes/Interweb Things
    Replies: 3
    Last Post: 27th November 2006, 09:42 PM
  4. Error deleting files or folder message
    By speckytecky in forum How do you do....it?
    Replies: 1
    Last Post: 15th November 2006, 03:21 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •