Skip to content

Commit

Permalink
Add support for sparse files (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
vxrtns authored Jun 10, 2024
1 parent 52d0d9a commit 1ad5f1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions log2ram
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ sync_to_disk() {
fi

if [ -z "${NO_RSYNC}" ] && [ -x "$(command -v rsync)" ]; then
rsync -aXv --inplace --no-whole-file --delete-after "${optional_params[@]}" "$RAM_LOG"/ "$HDD_LOG"/ 2>&1 |
rsync -aXv --sparse --inplace --no-whole-file --delete-after "${optional_params[@]}" "$RAM_LOG"/ "$HDD_LOG"/ 2>&1 |
tee -a "$LOG2RAM_LOG"
else
cp -rfup "$RAM_LOG"/ -T "$HDD_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"
cp -rfup --sparse=always "$RAM_LOG"/ -T "$HDD_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"
fi
}

Expand All @@ -75,9 +75,9 @@ sync_from_disk() {
fi

if [ -z "${NO_RSYNC}" ] && [ -x "$(command -v rsync)" ]; then
rsync -aXv --inplace --no-whole-file --delete-after "$HDD_LOG"/ "$RAM_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"
rsync -aXv --sparse --inplace --no-whole-file --delete-after "$HDD_LOG"/ "$RAM_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"
else
cp -rfup "$HDD_LOG"/ -T "$RAM_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"
cp -rfup --sparse=always "$HDD_LOG"/ -T "$RAM_LOG"/ 2>&1 | tee -a "$LOG2RAM_LOG"
fi

}
Expand Down

0 comments on commit 1ad5f1b

Please sign in to comment.