Updated rsync code to work in deploy phase