What I want in the following command is to find particular files and move them to the other directories while appending ".log" to the destination filename.
find /src/dir/ -type f -mtime +3 -exec mv {} /dst/dir/`basename {}`.log \;
But it fails because the basename
command enclosed in the backticks does not operate properly. $(basename {})
has similar result too.
mv: cannot move /src/dir/foo to /dst/dir//src/dir/foo.log: No such file or directory
Any idea would be appreciated.