Skip to content

Instantly share code, notes, and snippets.

@debussyman
Created September 11, 2014 18:41
Show Gist options
  • Save debussyman/290c14b704504a22c237 to your computer and use it in GitHub Desktop.
Save debussyman/290c14b704504a22c237 to your computer and use it in GitHub Desktop.
Delete file or folders that are modified in the past
find [/some/path] -mtime +[NumDays] [-type f] -exec rm -[r]f {} \;
@underscorenygren
Copy link

I give up...

day = 'Jul 14'
f = open('tmpfiles')
dir = '/mnt/tmp/'
f.readlines.each{|line| 
        name = line[0..lastindexof(' '))    
        fname = File.join(dir, name)        
        if !File.exists?(fname)             
        else  

        end   
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment