I have a requirement like following:
I have two dir: DIR1 and DIR2. Files of DIR1 are updated on a regular basis based on requirement. Then updated files are copied to DIR2. So I need to write a shell script which will tell us whether all the files in DIR2 are the updated files or not. This is to make sure that all required files were copied properly from DIR1 to DIR2.
Can anyone please help me how I'll compare the timestamp of a file between the 2 directories.
/home/user/DIR1]ls -l -rwxrwxr-x 1 user group 509 Jan 08 2009 file_1.dat -rwxrwxr-x 1 user group 11 Sep 29 12:19 file_2.dat /home/user/DIR2]ls -l -rwxrwxr-x 1 user group 509 Jan 08 2008 file_1.dat -rwxrwxr-x 1 user group 40 Oct 21 12:19 file_2.dat
Thanks & Regards, Prasenjit