A long time ago (almost 3 years ago to be exact), I blogged about command line backups for APEX. The script was originally for DOS and required configurations to be stored directly in the script.
Since making the script available I've had numerous requests to update it to support Linux and Mac users. I've done a major overhaul of the backup script which is now available on Github here.
The main changes are that all configurations can be stored in custom.properties and you won't lose your changes when you update the scripts from the repository.
If you have any comments, issues, or feedback please submit them in the project's issues page.