try rsync (works ok)

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-04-07 19:15:14 -07:00
parent 823e0c009c
commit 393a019b78
2 changed files with 10 additions and 7 deletions

View File

@ -16,5 +16,6 @@ func main() {
// simpleProcess("ping -c 10 localhost") // simpleProcess("ping -c 10 localhost")
// shell("ping localhost -c 5", 10) // 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("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/")
} }

View File

@ -34,21 +34,25 @@ func shell(cmdline string) {
time.Sleep(2 * time.Millisecond) // only check the buffer 500 times a second time.Sleep(2 * time.Millisecond) // only check the buffer 500 times a second
// log.Println("sleep done") // log.Println("sleep done")
oneByte := make([]byte, 10) oneByte := make([]byte, 1024)
count, err := nbr.Read(oneByte) count, err := nbr.Read(oneByte)
if (err != nil) { if (err != nil) {
log.Println("Read() count = ", count, "err = ", err) 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.Write([]byte(string(oneByte)))
f.Flush() f.Flush()
oneByte = make([]byte, 10) oneByte = make([]byte, 1024)
count, err = nbrerr.Read(oneByte) count, err = nbrerr.Read(oneByte)
if (err != nil) { if (err != nil) {
oneByte = make([]byte, 100) oneByte = make([]byte, 1024)
count, err = nbr.Read(oneByte) count, err = nbrerr.Read(oneByte)
f.Write([]byte(string(oneByte))) f.Write([]byte(string(oneByte)))
f.Flush() f.Flush()
@ -63,8 +67,6 @@ func shell(cmdline string) {
} }
// spew.Dump(reflect.ValueOf(cmd.Process).Elem()) // spew.Dump(reflect.ValueOf(cmd.Process).Elem())
/*
*/
} }
cmd.Wait() cmd.Wait()