Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can 'dd' from Unix to the cloud ... well, some clouds ...

  pg_dump -U postgres db | ssh user@rsync.net "dd of=db_dump"

  mysqldump -u mysql db | ssh user@rsync.net "dd of=db_dump"
... although these days, now that we support attic and borg[1], nobody does things like this anymore.

[1] http://www.rsync.net/products/attic.html



That has only one minor advantage compared to:

  mysqldump -u mysql db | ssh user@rsync.net "cat > db_dump"
Namely, the syntax is one character shorter. (But only because I used whitespace around >).

With dd, you can control the transfer units (the size of the read and write system calls which are performed) whereas cat chooses its own buffering. However, this doesn't matter on regular files and block devices. The transfer sizes only matter on raw devices where the block size must be observed. E.g. traditional tape devices on Unix where if you do a short read, or oversized write, you get truncation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: