]> git.rmz.io Git - dotfiles.git/blob - bin/old/rmold
vim: add markdown ftplugin
[dotfiles.git] / bin / old / rmold
1 #! /bin/bash
2
3 ##
4 # This script will remove all files/folders older than 2 weeks in the ~/Downloads
5 # folder.
6 ##
7
8 rm /Users/ramsi/Downloads/*.torrent
9
10 find $HOME/Downloads -atime +28 -depth 1 -print | while read FILE; do
11
12 # Adds support for files with spaces.
13 cmd="mv \"$FILE\" $HOME/.Trash";
14
15 # Parses the line twice to remove the external quotes.
16 eval $cmd;
17
18
19 echo "`date \"+%Y-%m-%d\"` removed $FILE" >> /var/log/rmold.log;
20
21 done;
22 return 0;