I remember that it was a family fleeing a horticulture moon or a planet and they were trying to flee to another planet but were repeatedly attacked by pirates.
I think it was from the 80's.
The "refugees constantly attacked every other chapter" matches very well with "Refugee" (book 1 of Piers Anthony's "Bio of a Space Tyrant" series).