Skip to content

Instantly share code, notes, and snippets.

@happypeter
Created July 22, 2012 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happypeter/3159567 to your computer and use it in GitHub Desktop.
Save happypeter/3159567 to your computer and use it in GitHub Desktop.
sync my happycasts/* to my server
#!/bin/bash
sync_dryrun()
{
echo
echo -e "\033[1m ...dryrun...\033[0m"
rsync -rv --delete ~/happycasts/episodes/ peter@linode:~/media/assets/episodes/ --dry-run
echo -e "\033[1m ...dryrun...\033[0m"
echo
}
sync_dryrun
sync_server()
{
echo
echo -e "\033[1m ...syncing...\033[0m"
rsync -arv --progress --delete ~/happycasts/episodes/ peter@linode:~/media/assets/episodes/
echo -e "\033[1m ...done...\033[0m"
echo
}
echo -n "Want to sync? (Y/n): "
read AAA
if [ "${AAA:-y}" = "y" ];then
sync_server
else
echo Nothing done, bye.
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment