brock
5/10/2016 - 6:14 PM

Life Pro Tip for using Rsync

Life Pro Tip for using Rsync

#!/bin/bash

rsync -av --exclude 'rsync' SERVER:/path/* .
  • Be me
  • forget the exact syntax for using rsync.
  • get nested folders by mistake or end up with lots of files in the current directory
  • sync files then delete files like 100 times as you try to remember the syntax
  • look at the man page and then try again
  • get nested folders by mistake or end up with lots of files in the current directory
  • sync files then delete files like 100 times as you try to remember the syntax
  • finally figure it out

  • create a file in this directory
  • call it rsync
  • paste in the command that just worked
  • make it executable: chmod +x rsync

  • now whenever I need to rsync the directory, I can just run
  • ./rsync
  • and whenever I see an rsync file in that directory, I know I've already figured out the syntax before
  • and the ladies be throwin theyselves at me