I have a directory structure as:/apps/amr. I want to take a backup of amr as it is(i.e without de-referencing links).Now the /apps directory has a different user and group that it belongs to( and i don’t have access to that). I am logged in as a different user and group. So obviously in /apps directory executing:
mkdir amr_backup
cp -dR amr amr_backup
doesn’t work as permission denied.
So,I am trying to do the same in /apps/amr directory as amr directory has the same user and group i logged in as. But when executing:
mkdir amr_backup
cp -dR * amr_backup
It shows this error:
cp: cannot copy a directory, `amr_backup`, into itself, `amr_backup/amr_backup'
which is obvious because the amr_backup directory itself is within /apps/amr.
And also I can see not everything is backed up properly:
du -sh /apps/amr
8.6G /apps/amr
du -sh /apps/amr/amr_backup
4.3G /apps/amr/amr_backup
So kindly give me a resolution around.
I say, keep it simple…
The glob expansion of
*will not include anything beginning with.so the hidden directory will not itself be a source directory.