Why does rollback save files using full path ?

Answered

Comments

2 comments

  • Avatar
    juanjo

    It is not currently possible to configure the prefix. The rollback directory uses the full path to the files to allow restoring modified files at any location in the system. If you are just interested in backing up the contents of the installation directory (or a subdirectory), you could manually create the backup using:

    <readyToInstallActionList>
        <createTimeStamp>
            <format>%Y%m%d%H%M%S</format>
            <variable>timestamp</variable>
        </createTimeStamp>
        <createBackupFile>
            <destination>${installdir}/backups/${timestamp}</destination>
            <path>${installdir}/importantFiles</path>
        </createBackupFile>
    </readyToInstallActionList>
    
  • Avatar
    juanjo

    It was implemented using the full path to allow backing up any file in the system. If a relative path to the installdir is used, just files overwritten inside the installation directory will be easily reproduced in the backup but it would be hard to determine the destination of a file in the home directory.

    In any case, I see your point. We will add your suggestion to our bug tracking system.

    As a workaround, what you could do is move the contents of the backup to another directory, relative to the installation directory:

    <postInstallationActionList>
        <actionGroup>
            <actionList>
                <createDirectory>
                    <path>${installdir}/backup</path>
                </createDirectory>
                <renameFile>
                    <destination>${installdir}/backup</destination>
                    <origin>${project.rollbackBackupDirectory}/${installdir}</origin>
                </renameFile>
                <deleteFile>
                    <path>${project.rollbackBackupDirectory}</path>
                </deleteFile>
            </actionList>
            <ruleList>
                <isTrue>
                    <value>${project.enableRollback}</value>
                </isTrue>
                <fileExists>
                    <path>${project.rollbackBackupDirectory}/${installdir}</path>
                </fileExists>
            </ruleList>
        </actionGroup>
    </postInstallationActionList>
    

Please sign in to leave a comment.