I want to rsync my data to other vps.

My 1st vps data is located in MERLIN directory,here is the path - /home/USERNAME/create/MERLIN

there are other folders and sub folders in USERNAME and create directory which I dont want to make backup.

My remote location of vps is - /home/USERNAME/similar/backup (I want to make my backup here)

rsync -r -a -e SSH remoteuser(user of my 1st vps)@remote_host(my 1st vps):/home/USERNAME/create/MERLIN /home/USERNAME/similar/backup 

But it syncs all other directories and sub directories apart from MERLIN directory and it's contents. How can I just make backup of only MERLIN and it's contents.

  • When you say "it syncs all other directories and sub directories", do you mean subdirectories in MERLIN? or these "other folders and subfolders in USERNAME and create directory which you don't want to make backup"? – Kamil Maciorowski Sep 12 at 18:40
  • Yes exactly I want only Merlin and it's sub directories contents. And not the folders of USERNAME and create (they both have other files too). When I sync my back up directory of other vps have all files from /home /USERNAME/create/ too which I don't want. I want only Merlin and it's total contents. – Merlincool Sep 12 at 19:39
  • Cannot replicate. In theory the tool should stay inside MERLIN. Omit the destination (so there is only one source and no destination) to make rsync list files that would be synced. Are files outside of MERLIN listed really? Pay attention to unquoted spaces in your actual command. If not sure, use --dry-run and --verbose just in case. – Kamil Maciorowski Sep 12 at 19:51
  • No my all files are inside MERLIN only. I am just begin to use rsync so not sure of the term what you are asking me to do. – Merlincool Sep 13 at 0:26
  • Does rsync -rae ssh --dry-run --verbose remoteuser@remote_host:/home/USERNAME/create/MERLIN list files that are outside of MERLIN? – Kamil Maciorowski Sep 13 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.