Skip to main content
added 442 characters in body
Source Link
Chris Davies
  • 128k
  • 16
  • 178
  • 323

This seems to fit your requirements

rsync -avR user@remote:'/backups/*/latest'latest/' /some/local/path/

The -R flag effectively "copies" the entire source path into the destination and the resulting backups will land as /some/local/path/backups/{whatever}/latest.

If you find you don't want the entire source path you can include /./ to indicate the point from which the path should be copied across to the destination. For example, /backups/./foo/latest/ would result in /some/local/path/foo/latest/ (i.e. the /backups component has been skipped). There's lots more detail in the documentation (man rsync).

This seems to fit your requirements

rsync -avR user@remote:'/backups/*/latest' /some/local/path/

The -R flag effectively "copies" the entire source path into the destination.

This seems to fit your requirements

rsync -avR user@remote:'/backups/*/latest/' /some/local/path/

The -R flag effectively "copies" the entire source path into the destination and the resulting backups will land as /some/local/path/backups/{whatever}/latest.

If you find you don't want the entire source path you can include /./ to indicate the point from which the path should be copied across to the destination. For example, /backups/./foo/latest/ would result in /some/local/path/foo/latest/ (i.e. the /backups component has been skipped). There's lots more detail in the documentation (man rsync).

added 2 characters in body
Source Link
Chris Davies
  • 128k
  • 16
  • 178
  • 323

This seems to fit your requirements

rsync -avR user@remote:'/backups/*/latestlatest' /some/local/path/

The -R flag effectively "copies" the entire source path into the destination.

This seems to fit your requirements

rsync -avR user@remote:/backups/*/latest /some/local/path/

The -R flag effectively "copies" the entire source path into the destination.

This seems to fit your requirements

rsync -avR user@remote:'/backups/*/latest' /some/local/path/

The -R flag effectively "copies" the entire source path into the destination.

Source Link
Chris Davies
  • 128k
  • 16
  • 178
  • 323

This seems to fit your requirements

rsync -avR user@remote:/backups/*/latest /some/local/path/

The -R flag effectively "copies" the entire source path into the destination.