X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/04fed8e4657d28df3ca947ea34c2a5d8f9ccc02f..61d7dd11d4a450a64f2817ee4db0ec7fa5880b42:/bin/old/rmold?ds=sidebyside diff --git a/bin/old/rmold b/bin/old/rmold new file mode 100755 index 0000000..a4c6644 --- /dev/null +++ b/bin/old/rmold @@ -0,0 +1,22 @@ +#! /bin/bash + +## +# This script will remove all files/folders older than 2 weeks in the ~/Downloads +# folder. +## + +rm /Users/ramsi/Downloads/*.torrent + +find $HOME/Downloads -atime +28 -depth 1 -print | while read FILE; do + + # Adds support for files with spaces. + cmd="mv \"$FILE\" $HOME/.Trash"; + + # Parses the line twice to remove the external quotes. + eval $cmd; + + + echo "`date \"+%Y-%m-%d\"` removed $FILE" >> /var/log/rmold.log; + +done; +return 0;