+ 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
    128
    Thank Post
    21
    Thanked 1 Time in 1 Post
    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. #2

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,802
    Thank Post
    272
    Thanked 1,135 Times in 1,031 Posts
    Rep Power
    349
    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)

  3. #3


    Join Date
    Sep 2007
    Location
    UK
    Posts
    5,394
    Thank Post
    1,417
    Thanked 872 Times in 560 Posts
    Rep Power
    643
    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.

  4. #4
    DaveMurphy's Avatar
    Join Date
    Aug 2009
    Location
    Manchester
    Posts
    207
    Thank Post
    12
    Thanked 9 Times in 8 Posts
    Rep Power
    13
    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.

  5. #5

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,802
    Thank Post
    272
    Thanked 1,135 Times in 1,031 Posts
    Rep Power
    349
    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

  6. #6

    TechMonkey's Avatar
    Join Date
    Dec 2005
    Location
    South East
    Posts
    3,286
    Thank Post
    225
    Thanked 405 Times in 302 Posts
    Rep Power
    162
    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.

  7. #7

    witch's Avatar
    Join Date
    Nov 2005
    Location
    Dorset
    Posts
    11,118
    Thank Post
    1,371
    Thanked 2,375 Times in 1,672 Posts
    Rep Power
    703
    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

  8. #8
    chrisredfield93's Avatar
    Join Date
    Feb 2009
    Location
    Wales
    Posts
    232
    Thank Post
    89
    Thanked 4 Times in 4 Posts
    Rep Power
    16
    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

  9. #9

    jinnantonnixx's Avatar
    Join Date
    Mar 2011
    Location
    In the Calamatorium.
    Posts
    1,958
    Thank Post
    109
    Thanked 482 Times in 331 Posts
    Blog Entries
    2
    Rep Power
    281
    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).

  10. #10

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,802
    Thank Post
    272
    Thanked 1,135 Times in 1,031 Posts
    Rep Power
    349
    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

  11. #11


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    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, 12:43 PM
  3. Circumvent your countries censorship...or schools?
    By mrforgetful in forum Jokes/Interweb Things
    Replies: 3
    Last Post: 27th November 2006, 08: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, 02: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
  •