+LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py
+RSYNC_EXCLUDES := --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
+RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
+RSYNC := rsync -ai $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
+
+sync:
+ifeq (,$(SSHURL))
+ @echo "sync: I need more info from the command line, e.g."
+ @echo " make sync PLC=boot.planetlab.eu"
+ @echo " make sync PLCHOSTLXC=.. GUESTHOSTNAME=.. GUESTNAME=.."
+ @exit 1
+else
+ +$(RSYNC) plcsh PLC planetlab5.sql migrations php $(SSHURL)/usr/share/plc_api/
+ +$(RSYNC) db-config.d/ $(SSHURL)/etc/planetlab/db-config.d/
+ +$(RSYNC) plc.d/ $(SSHURL)/etc/plc.d/
+ +$(RSYNC) apache/plc.wsgi $(SSHURL)/usr/share/plc_api/apache/
+ $(SSHCOMMAND) systemctl restart plc
+endif