I would use GNU ddrescue to clone the drive to an image.
To install ddrescue
$ sudo apt-get update && apt-get install gddrescue
Basic launch command (with the device unmounted)
$ sudo ddrescue -r 3 /dev/sdb ./recovery.dd ./recovery.log
(-r 3 is three retries, /dev/sdb is the path to the block device for the CF card, recovery.dd is the image file to be created and recovery.log is the log file)
The image file will be the same size as the CF card. This creates a log file, if the CF card goes offline it can be disconnected, reconnected and the above command can be run to relaunch the recovery at the next block.
If everything is successful you can mount the the image's partitions as loop devices or use dd to write the image to another CF card.
I/O errors generally mean the CF card needs to be replaced.
Hope this gets you started.