Skip to content

Instantly share code, notes, and snippets.

@brock
Last active May 10, 2016 18:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brock/9b84b2ab6ad608cf44bde0051afb9a68 to your computer and use it in GitHub Desktop.
Save brock/9b84b2ab6ad608cf44bde0051afb9a68 to your computer and use it in GitHub Desktop.
Life Pro Tip for using Rsync
  • 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
#!/bin/bash
rsync -av --exclude 'rsync' SERVER:/path/* .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment