Question

I am currently using a combination of dd, gzip and nc to remote backup the flash of an arm board.

dd if=/dev/nand conv=sync,noerror bs=64K | gzip -c -9 | nc 192.168.0.123 8000

I'd like to ask whether there is an efficient way to omit nc and transfer the data via ssh.

Furthermore, I am also looking for a solution where the backup process is initiated by the 'backup server'.

Was it helpful?

Solution

Something along these lines?

dd if=/dev/nand conv=sync,noerror bs=64K | gzip -c -9 | ssh user@server 'cat - > backup.gz'

OTHER TIPS

I'm not so sure that sync is a good conversion flag to use. The dd man page says:

   sync   pad  every  input block with NULs to ibs-size; when used with block or unblock, pad
          with spaces rather than NULs

I don't think you want to pad with anything. Perhaps this was meant to be passed to iflags instead:

   dsync  use synchronized I/O for data

   sync   likewise, but also for metadata

or perhaps direct instead:

   direct use direct I/O for data

which is slightly faster on my Cubieboard2's nand.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top