Copy and synchronize file commands between Linux machines

Source: Internet
Author: User
Tags scp file rsync

  1. 1 different machine copy files
  2. SCP file Login user @ Machine ip:/Directory/Sub-directory
  3. SCP filename [email protected]10.20. 130.202:/home/test/
  4. 2 file [clip] Sync rsync
  5. Question [NET friend proposed]
  6. How do I write a command of a Linux value that copies one or several subdirectories? If there are several directories under/project,/project/aaa/project/ccc/project/ddd .... I want to copy the PROJECT/AAA into the/tmp directory, the project directory is also copied (and you don't want to use mkdir to create project in the TMP directory first.) Because this is just an example), I actually want to back up the system, that is, some folders and files in a directory to backup, but some folders and files are not copied, such as log folders, etc.
  7. Look at the following directory
  8. [[email protected] dass] # ll
  9. Total 260
  10. Drwxrwxr-x 7 dass dass 4096 Oct bonus-portal
  11. Drwxrwxr-x 8 dass dass 4096 Mar cis-portal
  12. DRWXRWXRWX 6 201 201 4096 Nov cronolog-1.6. 2
  13. -rw-rw-r-- 1 dass dass 193967 Oct cronolog-1.6. 2.tgz
  14. Drwxr-xr-x 8 dass dass 4096 Oct iad-api
  15. Drwxr-xr-x 8 dass dass 4096 Oct ias-api
  16. Drwxr-xr-x 8 dass dass 4096 Oct ias-iboss
  17. Drwxrwxr-x 7 dass dass 4096 Oct info-portal
  18. Drwxrwxr-x 7 dass dass 4096 Oct pis-portal
  19. Drwxrwxr-x 7 dass dass 4096 Apr 4 pp_tomcat6
  20. Drwxr-xr-x 7 dass dass 4096 Nov regist-api
  21. Drwxrwxr-x 7 dass dass 4096 Oct sis-portal
  22. Drwxrwxr-x 7 dass dass 4096 3 :sqxx-portal
  23. Drwxr-xr-x dass dass 4096 Oct ( tomcat )
  24. Drwxrwxr-x 7 dass dass 4096 Oct tvs-portal
  25. Drwxr-xr-x 7 dass dass 4096 Nov vod-img-task
  26. Drwxr-xr-x 7 dass dass 4096 Oct vod-portal
  27. [[email protected] dass] # pwd
  28. /opt/dass
  29. Just want to copy the/opt/dass/tomcat directory to/tmp
  30. Execute the following command:
  31. Rsync-ar/opt/dass/tomcat/tmp
  32. What is Rsync?
  33. SHANGHAI-big wave scouring sand () :
  34. Synchronization commands
  35. And you can sync it to another machine.
  36. Pingxiang-Mark Hurd () :
  37. Oh
  38. SHANGHAI-big wave scouring sand () :
  39. The same file will not be copied again
  40. Pingxiang-Mark Hurd () :
  41. As if it was a RAC or something.
  42. SHANGHAI-Big Wave Amoy () :
  43. Why I only add-R No,-ar on the line-a see man is archive
  44. Man can't understand, ah, can use on the line!
  45. Shanghai-miracle (): :
  46. It is a quick means of saying you want recursion and want to preserve almost everything-a this should be allowed to be recursive and reserved permissions
  47. SHANGHAI-Big wave Amoy :
  48. Well
  49. Shanghai-miracle () :
  50. If you have a hard link, add-h

http://hehaibo.iteye.com/blog/1326495

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.