I am searching files who have either been created or modified for the last 60 minuts. I find these via
find ~/data/ -cmin -60 -mmin -60 -type f
~ the home directory
After that I want to copy these files and preserve the main folder structure... The results of the find command are for instance...
/usr/wg/data/foo1/file1.txt /usr/wg/data/foo2/bar2/file2.txt ...
Now when I use
rsync -a `find ~/data/ -cmin -60 -mmin -60 -type f` ~/vee/
In the folder
~/vee/ I get
/usr/wg/vee/usr/wg/data/foo1/file1.txt /usr/wg/vee/usr/wg/data/foo2/bar2/file2.txt ...
While I want
/usr/wg/vee/foo1/file1.txt /usr/wg/vee/foo2/bar2/file2.txt ...
How do I achieve this? I looked at
- How to copy modified files while preserving folder structure
and several other answers, but I do not seem to get it right.