/ Published in: Bash
Command to search for a file type, in the case of the example any ending with .sql in the name, that is last modified over a certain time (45 days in example), and shred that file
Use command with extreme caution, suggest running "find /path/to/start/search -name "*.sql" -mtime +45 -print" first to verify the files that are going to be shred before actually running this command. There is no undo from BASH shred :-)
Expand |
Embed | Plain Text
# Suggestion, first run the 'print' command to preview which files are going to be shredded find /path/to/start/search -name "*.sql" -mtime +45 -print # When you are comfortable with what you have you can shred find /path/to/start/search -name "*.sql" -mtime +45 | xargs shred -fuvz
You need to login to post a comment.
