Need Help

Hi

Please help in writing shell script for removing the 60 days older files. and if the files are not 60 days older then they should be zipped and zipped files are to be move to the seperate directory.

Thanks in advance.

Look into the man page for "find", especially the switch "-mtime"; experiment with the find command.

#To purge the files which are older than 60 days
find [dir] -name [file] -mtime +60 -exec rm -rf {} \;

#gzipping the old Hi*.txt files
for i in `find [dir] -name [file] -mtime +59`
do
gzip $i
#write move cmd here: mv [source dir] [target dir]
done

#Please test the code before you implement.

Thanks
Sarwan