mirror of
https://codeberg.org/h3xx/optipdf
synced 2024-08-15 00:03:23 +00:00
Support keeping backups of old files
This commit is contained in:
parent
5b63a4c4df
commit
a6a00d300c
1 changed files with 5 additions and 0 deletions
5
optipdf
5
optipdf
|
@ -2,6 +2,7 @@
|
|||
# vi: et sts=4 sw=4 ts=4
|
||||
|
||||
PRESERVE_TIMESTAMP=0
|
||||
KEEP_BACKUP_SUFFIX=.old-unoptimized
|
||||
|
||||
TEMP_FILES=()
|
||||
cleanup() {
|
||||
|
@ -99,6 +100,10 @@ use_smaller() {
|
|||
"$TEMP"
|
||||
fi &&
|
||||
|
||||
if [[ -n $KEEP_BACKUP_SUFFIX ]]; then
|
||||
mv -vi -- "$FILE" "$FILE$KEEP_BACKUP_SUFFIX"
|
||||
fi &&
|
||||
|
||||
cp \
|
||||
--preserve=mode,ownership,timestamps \
|
||||
-- \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue