Guest User

Untitled

a guest
Jun 18th, 2019
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tar + rsync + untar
  2.  
  3. tar (from src to dest) + untar
  4.  
  5. rsync
  6.  
  7. tar -C /src/dir -jcf - ./ | ssh user@server 'tar -C /dest/dir -jxf -'
  8.  
  9. scp -Cr srcdir user@server:destdir
  10.  
  11. mkdir tmp; cd tmp
  12. for i in {1..5000}; do dd if=/dev/urandom of=file$i count=1 bs=10k; done
  13.  
  14. time rsync -r tmp server:tmp2
  15.  
  16. real 0m11.520s
  17. user 0m0.940s
  18. sys 0m0.472s
  19.  
  20. time (tar cf demo.tar tmp; rsync demo.tar server: ; ssh server 'tar xf demo.tar; rm demo.tar'; rm demo.tar)
  21.  
  22. real 0m15.026s
  23. user 0m0.944s
  24. sys 0m0.700s
  25.  
  26. wc -l rsync.log rsync+tar.log
  27. 36730 rsync.log
  28. 37962 rsync+tar.log
  29. 74692 total
  30.  
  31. 1a/ tar files from source machine over the network to a .tar file on remote machine
  32.  
  33. $ tar cf /mnt/backup/cache.tar ~/.cache
  34.  
  35. 1b/ untar that tar file on the remote machine itself
  36.  
  37. $ ssh admin@nas_box
  38. [admin@nas_box] $ tar xf cache.tar
  39.  
  40. 2/ rsync files from source machine over the network to remote machine
  41.  
  42. $ mkdir /mnt/backup/cachetest
  43. $ rsync -ah .cache /mnt/backup/cachetest
  44.  
  45. 1a - 33 seconds
  46.  
  47. 1b - 1 minutes 48 seconds
  48.  
  49. 2 - 22 minutes
  50.  
  51. tar cf - ~/.cache | ssh admin@nas_box "(cd /destination ; tar xf -)"
  52.  
  53. rsync --compress --stats --no-blocking-io --files-from=fileList.txt -av otherSystem:/the/other/dir/ dest/
  54.  
  55. ssh otherSystem "cd /the/other/dir/; tar cf - ." | tar xvf -
  56.  
  57. Host otherSystem
  58. Hostname dataSource.otherSide.com
  59. User myUser
  60. Port 22
  61. ProxyCommand ssh -q -W %h:%p intermediary.otherSide.com
  62. IdentityFile id_rsa.priv
RAW Paste Data