Why Use Incremental Backup?
Enabling the incremental backup feature significantly improves resource usage and efficiency by focusing only on data that has changed since the last successful run. |
Characteristic |
Benefit |
|
Space Savings |
The primary benefit is saving disk space by only exporting files whose content has been modified. |
|
Time Efficiency |
The backup job completes faster because it avoids re-copying large amounts of unchanged data. |
|
Sequential Efficiency |
The current backup folder is always used as the basis for the next incremental run. The system relies on the existence and timestamps of files within this target directory. |
Synchronizing File Deletions
This incremental backup system performs a crucial synchronization step: it actively ensures the content in the target backup directory accurately reflects the content currently in the source repository.
Deletion Synchronization Logic
If a file that was present in the last successful backup has since been deleted from the source repository, the incremental process removes that file from the backup directory as well.
This synchronization provides two major benefits:
- True Size Reduction: By removing obsolete files from the target directory, the overall size of the backup folder is reduced, and the efficiency of future backup runs is maintained.
- Backup Accuracy: The current backup directory remains an accurate, clean mirror of the source repository's present state.
Deletion Confirmation Log
When the system removes a file from the backup directory, it logs a DEBUG message confirming the action:
2025-09-23T22:15:06.160Z [jfrt ] [DEBUG] [61a50517cb5d542e] [.r.d.i.DbRepoExportHandler:231] [5d542e|art-exec-6973] - Deleting /var/opt/jfrog/artifactory/backup/artifactory/current/repositories/generic-local/a.txt from the incremental backup dir since it was deleted from the repository
How the Incremental Check Works (Content Skipping)
When incremental backup is active, the system checks every source file to decide whether its content needs to be exported.
File Skipping Logic
The decision to skip a file is based on a timestamp comparison between the file in the source repository and the corresponding file in the target backup directory.
- The system first checks if the target file already exists from a previous backup.
- If the file exists, it compares the last modified timestamp of the Source File with the last modified timestamp of the Target File.
- If the source file's timestamp is not newer than the target file's timestamp (specifically, the difference is less than a millisecond), the system determines the file has not been modified and skips the content export.
Enabling Debug Logging for Incremental Activity
To view the specific details of files being skipped or deleted, you must enable DEBUG level logging for the relevant package in your logback.xml configuration file.
Required Log Configuration
Ensure the following configuration exists, which directs log output to a dedicated artifactory-backup.log file:
<appender name="backup" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${log.dir}/artifactory-backup.log</File>
<rollingPolicy class="org.jfrog.common.logging.logback.rolling.FixedWindowWithDateRollingPolicy">
<FileNamePattern>${log.dir.archived}/artifactory-backup.%i.log.gz</FileNamePattern>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>25MB</MaxFileSize>
</triggeringPolicy>
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.jfrog.common.logging.logback.layout.BackTracePatternLayout">
<pattern>%date{yyyy-MM-dd'T'HH:mm:ss.SSS, UTC}Z [jfrt ] [%-5p] [%-16X{uber-trace-id}] [%-30.30(%c{3}:%L)] [%-20.20thread] - %m%n</pattern>
</layout>
</encoder>
</appender>
<logger name="org.artifactory.repo.db.importexport" additivity="false">
<level value="debug"/>
<appender-ref ref="backup"/>
</logger>
The Skipped File Log
Once configured, the system logs a DEBUG message confirming when a file's content copy operation was skipped:
2025-10-01T18:33:39.980Z [jfrt ] [DEBUG] [...] - Skipping not modified file docker-XXXXX-lic-local:linux/ubi9/sha256:XXXXX/sha256__YYYYYY
This log entry confirms the incremental logic is working as intended, preventing the re-export of unchanged content.