Skip to content

Instantly share code, notes, and snippets.

@nathanlong
Last active June 15, 2017 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nathanlong/235bc94e2effa1688a9f3f63c1b6bb37 to your computer and use it in GitHub Desktop.
Save nathanlong/235bc94e2effa1688a9f3f63c1b6bb37 to your computer and use it in GitHub Desktop.
Gulp Rsync
var gulp = require('gulp');
var rsync = require('gulp-rsync');
gulp.task('deploy', function(){
// Dirs and Files to sync
rsyncPaths = ['rsynctest01' ];
// Default options for rsync
rsyncConf = {
verbose: true,
incremental: true,
relative: true,
emptyDirectories: true,
recursive: true,
clean: true,
exclude: ['node_modules', '.svn', '.git'],
hostname: '', // hostname
username: '', // ssh username
destination: 'rsynctest02', // path where uploaded files go
};
// Use gulp-rsync to sync the files
return gulp.src(rsyncPaths)
.pipe(rsync(rsyncConf));
});
gulp.task('watch', function(){
gulp.watch('rsynctest01/**/*', ['deploy']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment