Copy a directory locally with all permissions and attributes
move folder to new disk linux | copy vhosts to another partition | copy preserving permissions and owner | cp -a alternative with progress | rsync | copy | aclCaution: This command changes the system. Understand what it does before you run it.
rsync -aHAX --info=progress2 /var/www/vhosts/ /mnt/newdisk/vhosts/-a preserves permissions, owners, groups, timestamps and symlinks, -H hard links, -A ACLs and -X extended attributes. --info=progress2 shows overall progress instead of one line per file. If the run is interrupted, running it again only transfers the rest.
Note: Files with the same name at the destination are overwritten. Owners can only be preserved when running as root.
Also searched as
- move folder to new disk linux
- copy vhosts to another partition
- copy preserving permissions and owner
- cp -a alternative with progress