I have some example commands on
This page. I think for a CDRW, you can combine the commands to create a multisession CDRW if you want, and there is also the commands for blanking a CDRW there.
I don't know what is installed in an Ubuntu server install, so you may need to install cdrecord and mkisofs:
"apt-get install mkisofs cdrecord"
I hope this helps
--Ian