A menos que você tenha esquecido de fornecer informações importantes, o script a seguir funcionará.
#!/usr/bin/env bash
for DIR in my_work/* ; do
mkdir -pv dest/"$DIR"
cp -av "$DIR"/*.cfg "$DIR"/keepdir* dest/"$DIR"
done
Exemplo de saída, com curingas não aplicáveis produzindo mensagens:
dest
dest/my_work
dest/my_work/dir1
my_work/dir1/file.cfg -> dest/my_work/dir1/file.cfg
my_work/dir1/keepdir1.ddd -> dest/my_work/dir1/keepdir1.ddd
my_work/dir1/keepdir2.ddd -> dest/my_work/dir1/keepdir2.ddd
dest/my_work/dir2
my_work/dir2/file.cfg -> dest/my_work/dir2/file.cfg
cp: my_work/dir2/keepdir*: No such file or directory
dest/my_work/dir3
cp: my_work/dir3/*.cfg: No such file or directory
cp: my_work/dir3/keepdir*: No such file or directory