try rsync (works ok)
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
823e0c009c
commit
393a019b78
|
@ -16,5 +16,6 @@ func main() {
|
|||
// simpleProcess("ping -c 10 localhost")
|
||||
// shell("ping localhost -c 5", 10)
|
||||
// shell("if=/home/pinebook/factory/factory-pine14inch of=/dev/sdb2 status=progress bs=1M oflag=sync count=300", 10)
|
||||
shell("rsync -av --progress --inplace /home/pinebook/factory/factory-pine14inch work3.lab.wit.com:/home/pinebook/factory/")
|
||||
// shell("rsync -av --progress --inplace /home/pinebook/factory/factory-pine14inch work3.lab.wit.com:/home/pinebook/factory/")
|
||||
shell("rsync -av --progress /home/pinebook/factory/FACTORY-IMAGER-ROOTFS work3:/home/pinebook/factory/")
|
||||
}
|
||||
|
|
|
@ -34,21 +34,25 @@ func shell(cmdline string) {
|
|||
time.Sleep(2 * time.Millisecond) // only check the buffer 500 times a second
|
||||
// log.Println("sleep done")
|
||||
|
||||
oneByte := make([]byte, 10)
|
||||
oneByte := make([]byte, 1024)
|
||||
count, err := nbr.Read(oneByte)
|
||||
|
||||
if (err != nil) {
|
||||
log.Println("Read() count = ", count, "err = ", err)
|
||||
oneByte = make([]byte, 1024)
|
||||
count, err = nbr.Read(oneByte)
|
||||
f.Write([]byte(string(oneByte)))
|
||||
f.Flush()
|
||||
}
|
||||
f.Write([]byte(string(oneByte)))
|
||||
f.Flush()
|
||||
|
||||
oneByte = make([]byte, 10)
|
||||
oneByte = make([]byte, 1024)
|
||||
count, err = nbrerr.Read(oneByte)
|
||||
|
||||
if (err != nil) {
|
||||
oneByte = make([]byte, 100)
|
||||
count, err = nbr.Read(oneByte)
|
||||
oneByte = make([]byte, 1024)
|
||||
count, err = nbrerr.Read(oneByte)
|
||||
f.Write([]byte(string(oneByte)))
|
||||
f.Flush()
|
||||
|
||||
|
@ -63,8 +67,6 @@ func shell(cmdline string) {
|
|||
}
|
||||
|
||||
// spew.Dump(reflect.ValueOf(cmd.Process).Elem())
|
||||
/*
|
||||
*/
|
||||
}
|
||||
|
||||
cmd.Wait()
|
||||
|
|
Loading…
Reference in New Issue