Skip to content

07. Logging and Backup

scd4j edited this page Dec 14, 2014 · 6 revisions

Logging

Every execution generates a log file into the log folder.

To ensure you message goes to the log file, do not use println, instead use log(..) function. For example:

pre {
    if( isLinux() ) {
        log("Linux box. Starting installation.")
        return CONTINUE_INSTALLATION
    }

    log("Not a Linux box. Aborting installation.")
    return CANCEL_INSTALLATION
}

Backups

Although SCD4J do backup of every changed or deleted files (see backup dir), it does not backup executions made by programming in hook files. So, we strongly recommend to take a snapshot of your production environments before executing a new configuration. This way, you can quickly rollback if something goes wrong.

Clean up

Once we store logs and make backups, the folders log and backup can get big very fast. Because of this, we suggest you to define a clean up policy in order to avoid running out of disk space.

You can use SCD4J to install a daily cron Job for cleaning those folders up. ;-)

Clone this wiki locally