Skip to content

Instantly share code, notes, and snippets.

@manuelmorales
Created May 28, 2012 07:32
Show Gist options
  • Select an option

  • Save manuelmorales/2817866 to your computer and use it in GitHub Desktop.

Select an option

Save manuelmorales/2817866 to your computer and use it in GitHub Desktop.
Delete dirs older (last modified before) than a week
# From http://systembash.com/content/delete-directories-older-than-week/
for i in `find /home/backup/ -maxdepth 1 -type d -mtime +7 -print`; do echo -e "Deleting directory $i";rm -rf $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment