Netbeans: rsync with remote server

rsync netbeans

So you’re still using Eclipse/PDT because you see no way to rsync your local files with your remote dev machine.

This is the workaround I use:

  •  Create a “rsync.php” file in your project root, with this content. You’ll see this would be the Mac version, change the bits according yo your OS:

<?php

system(“/opt/local/bin/rsync -uvrz –chmod=uga+rx –delete-after –exclude-from=/Users/USERNAME/rsyncExclude.txt .  USERNAME@HOSTNAME:/home/USERNAME/PROJECT_PATH”);

  •  Create a rsyncExclude.txt file with the file patterns you need to avoid syncing and place it in your home dir:
.settings
.buildpath
.project
.hg
rsync.php
  • Project > Properties > Run configuration

Run As: “script (run in command line)”

Make sure you configure the php cli.

Index file: rsync.php

Working directory: your project directory.

  •  That’s all. Now you can use “Run Project (F6)” to rsync.

Let me know if you’ve found another way to achieve this without hacking Netbeans.

Leave a comment