Originally Posted by ramesh pagadala
1) i want delete the direcotries which is older than 3 months ex. /opt/pat/phd in this phd directory daily created some directories and for each directory is having different files ex txt,log ect so i want remove all files also
2) i want compress the directories which is older than 3 months ex./opt/pat/phd in this phd directory daily created some directories i think based on timestamp not exactly i want compress those directories which is older than 7 days.
please let me know if any one knows.
We'll be glad to help you...so post what you've done/tried so far, and tell us where you're stuck. Reading the man pages as Firerat suggested will help you, and I'll add to read the man page on the 'rm' command.
Pay particular attention to the "-*time" flags on the find command (mtime, ctime, atime), and the "-rf" flag on the rm command.