Monitoring file in a directory

Hi I need the commands that will enable me to monitor the files in a directory, preferably by date of the file and copy those files that have changed to a new directory.

Please can someone help?

Many thnaks in advance

Kind regards from

Pete

Please check the FAQs before posting. If you had looked here, you would have found your answer. Check the part where find is used in conjunction with touch.

this was the code I came up with and it does not work.

Any suggestions are much appreciated.

#!/usr/bin/ksh

Path=/home/test1
Path2=/home/test2

if find -mtime $Path -newer $Path2
then cp $Path $Path2

fi

Your syntax is incorrect. The '-mtime' argument expects to be followed by a positive/negative integer or an integer without any signs preceding it.
The mtime argument will find files older than/ newer than or exactly as old as the number of days specified. Please check the man page of find on your system for more details.