Skip to content

Instantly share code, notes, and snippets.

@perfectfoolish
Forked from happypeter/happycasts_sync.sh
Created December 13, 2012 12:31
Show Gist options
  • Save perfectfoolish/4276085 to your computer and use it in GitHub Desktop.
Save perfectfoolish/4276085 to your computer and use it in GitHub Desktop.
#!/bin/bash
sync_dryrun()
{
echo
echo -e "\033[1m ...dryrun...\033[0m"
rsync -vr --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