Configuration Export

  • Can the exported .sql file be named with the version/revision?

    For example,

    FOG 1.2.0 would be named fog_backup_1.2.0.sql

    FOG r3333 would be named fog_backup_r3333.sql

    Extra credit:
    Can the date be included, too? fog_backup_r3333_4-30-2015.sql

  • Senior Developer

    If you’re trying to just add version, it at that point has already loaded System.class.php. All you’d need to do is append the FOG_VERSION to the file name. But scufa doesn’t always change even though it does always ask to check. Maybe date is better option as even if you revert the newer items are likely not read anymore.

  • also,

    this file:

    Contains the FOG version.

    I was trying to use “include_once” to try to make it work in ReportMaker.class.php but I totally screwed it up.

  • A new chunk that impliments the date for configuration save.


    chunk edited:

    $current_date = date(‘m/d/Y == H:i:s’);
    exec(‘mysqldump --opt -u’.DATABASE_USERNAME.’ -p"’.DATABASE_PASSWORD.’" -h’.preg_replace(’#p:#’,’’,DATABASE_HOST).’ ‘.DATABASE_NAME.’ > '.$path.$filename);
    header(‘X-Content-Type-Options: nosniff’);
    header(‘Strict-Transport-Security: max-age=16070400; includeSubDomains’);
    header(‘X-XSS-Protection: 1; mode=block’);
    header(‘X-Frame-Options: deny’);
    header(‘Cache-Control: no-cache’);
    header(‘Content-Type: application/octet-stream’);
    header(‘Content-Disposition: attachment; filename=’.$filename);
    exec('rm -rf '.$path.$filename);

    Tested working on r3333

  • Developer

    the date seems more practical (and slightly easier) than the version to me. you should probably have records of what version you of software you were running for a given time-frame anyway.