Copy a folder keeping owners and permissions intact

sudo cp -rp /home/my_home /media/backup/my_home

From cp manpage:

-p same as --preserve=mode,ownership,timestamps

--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all
Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.