#!/bin/bash
### Declare array ###
ARRAY=( `ypcat passwd | awk -F: '{print $1}'` )
### Get number of elements in the array ###
ELEMENTS=${#ARRAY[@]}
### Delete folders older then 14 days in users directory ###
for (( i=0;i<$ELEMENTS;i++)); do
/usr/bin/find /nas/data/accelrys/pp/web/jobs/"${ARRAY[${i}]}" -mtime +14 -exec rm -rf {} \;
done
Tuesday, November 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment