Lego2012
2/3/2017 - 9:14 PM

Using Rsync to Upload Files

Using Rsync to Upload Files

namespace :rsync do
  desc "--dry-run rsync"
    task :dryrun do
      system('rsync _site/ -ave ssh --dry-run --delete USERNAME@YOURDOMAIN.com:YOURHOSTDIRECTORY')
    end
  desc "rsync"
    task :live do
      system('rsync _site/ -ave ssh --delete USERNAME@YOURDOMAIN.com:YOURHOSTDIRECTORY')
    end
end

# Usage
# rake rsync:dryrun # If you're not sure, do dry-run
# rake rsync:live # Rsync to your server