I'm attempting to find and copy files that have been modified within the last day. While doing that I'm trying maintain folder structures under dir1dir1. There are many sub directoriessubdirectories under dir1dir1 and data files within those.
Below is what I cobbled together so far but apparently mtimemtime is not updated on directories if the contents of a file is updated. Also I believe this cp command will copy all of the files in a directory rather than just those that have changed.
find /NAS/data/dir1 -type d -mtime -1 -exec cp -at /mnt/databackup/dir1 {} +
find /NAS/data/dir1 -type d -mtime -1 -exec cp -at /mnt/databackup/dir1 {} +
If I didused -type f-type f it would not retain the folder structure.