Here is my problem. Every night I move data to a remote location, the data retains its modified date correctly, but the folders do not consistently. What I would like to do is to check the folders modified dates and if the local date is older than the remote date, I want to run touch on that folder to make it newer.
My folder structure should look something like this:
/srv/remote ├── dirA │ ├── dirA1 │ ├── file1 │ └── file2 └── dirB └── file1 /srv/local ├── dirA │ ├── dirA1 │ ├── file1 │ └── file2 │ └── file3 │ ├── dirA2 │ ├── file1 └── dirB └── file1
I did find this, touch all folders in a directory , which helps with how to touch each folder, but I can't figure out a find command that will compare the modified time of the mirrored folder (if one exists) to list the folders that need to be touched.