diff --git a/rsync.go b/rsync.go index 252a36d..2602eef 100644 --- a/rsync.go +++ b/rsync.go @@ -232,6 +232,10 @@ func (r Rsync) Run() error { return r.cmd.Wait() } +func (r Rsync) Cmd() *exec.Cmd { + return r.cmd +} + // NewRsync returns task with described options func NewRsync(source, destination string, options RsyncOptions) *Rsync { arguments := append(getArguments(options), source, destination) diff --git a/task.go b/task.go index aa60b83..cd7fa5a 100644 --- a/task.go +++ b/task.go @@ -5,6 +5,7 @@ import ( "bytes" "io" "math" + "os/exec" "strconv" "strings" "sync" @@ -79,6 +80,10 @@ func (t *Task) Run() error { return err } +func (r Task) Cmd() *exec.Cmd { + return r.rsync.cmd +} + // NewTask returns new rsync task func NewTask(source, destination string, rsyncOptions RsyncOptions) *Task { // Force set required options