rsync --dry-run -ahviPHX /mnt/bar /mnt/foo/
explainshell
*This will result in
bar
existing infoo
so you'd have/mnt/foo/bar/bar1.jpg
rsync --dry-run -ahviPHX /mnt/bar/* /mnt/foo/
explainshell
*This will result in solely the non-hidden contents of
bar
(bar/*
) existing insidefoo
so you'd have/mnt/foo/bar1.jpg
When using this to transfer over a network, consider using the following:
--delay-updates
which will ensure your active usecases aren't seeing temp/stub files--timeout=300
has rsync quit out if the connection is failing- When referencing a module + path, to copy the contents of the directory, verify you use
<module-name>/<dir>/
- To view modules or their contents, use
rsync rsync://<hostname>/
orrsync <hostname>::
, then build the path to view its contents.
Don't use
compress
! You don't need it and you'll incur extra cpu overhead which will impact performance