synk

synchronize files between hosts
Log | Files | Refs | README | LICENSE

commit 63b3591f24ae303a61fd0c0be9f4bef8a4e98a24
parent 9aeb4bdc5ffb6c15f8ac96fadb3da1daa32e3c0e
Author: Willy <willyatmailoodotorg>
Date:   Sat Sep  3 23:46:08 +0200

Actually run the rsync command generated

Diffstat:
synk.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/synk.c b/synk.c @@ -478,7 +478,12 @@ dosync(struct peer_t *master, struct peer_t *slave) master->host, echo(cmd), NULL }); } - puts(echo(cmd)); + if (!fork()) { + log(LOG_VERBOSE, "%s\n", echo(cmd)); + execvp(cmd[0], cmd); + perror(cmd[0]); + return -1; + } free(cmd); return 0; @@ -534,7 +539,7 @@ spawnremote(struct peers_t *plist) inet_ntoa(tmp->peer.sin_addr)); cmd = concat(2, ssh_cmd, (char *[]){ tmp->host, synk_cmd, NULL }); if (!fork()) { - puts(echo(cmd)); + log(LOG_VERBOSE, "%s\n", echo(cmd)); execvp(cmd[0], cmd); perror(cmd[0]); return -1;