diff options
| author | Dennis Fink | 2026-05-16 12:39:15 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-05-16 12:39:15 +0200 |
| commit | 054a300fe5b81ed04f84e902e05c4f4efb95a193 (patch) | |
| tree | 73eacbd9acd751a41ad326a23b29764e1475445f /transcode.sh.1 | |
| parent | 4bb37025cf1b4516acd2746dc60ec59449e8aab0 (diff) | |
| download | transcode.sh-054a300fe5b81ed04f84e902e05c4f4efb95a193.tar.gz transcode.sh-054a300fe5b81ed04f84e902e05c4f4efb95a193.zip | |
feat(backup): add original file backups
Add --backup-dir support so successful encodes can copy the original
file to an existing backup directory before replacing it.
Preserve each source file's absolute path below the backup directory and
avoid overwriting existing backups by appending numeric suffixes when
needed.
Document the new CLI and config option, and add directory completion for
the backup path.
Diffstat (limited to 'transcode.sh.1')
| -rw-r--r-- | transcode.sh.1 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/transcode.sh.1 b/transcode.sh.1 index c95f74e..c827336 100644 --- a/transcode.sh.1 +++ b/transcode.sh.1 @@ -86,6 +86,12 @@ Combine with .B \-v to see the detected codec and pixel format information. .TP +.BR \-\-backup\-dir " \fIDIR\fR, " \-\-backup\-dir= \fIDIR\fR +Copy originals to \fIDIR\fR before replacing them after successful encoding. +\fIDIR\fR must already exist; the script exits with a usage error if it does +not. Backups preserve the source file's absolute path below \fIDIR\fR, and +existing backup files are not overwritten. +.TP .BR \-\-hwaccel " [\fIMETHOD\fR], " \-\-hwaccel= \fIMETHOD\fR Pass .BI \-hwaccel " METHOD" @@ -226,6 +232,23 @@ which prints every command as it is executed. .B XDG_CONFIG_HOME Base directory for user configuration. Defaults to .BR $HOME/.config . +.SH BACKUPS +When +.BR \-\-backup\-dir +is used, backups are only created after +.BR ffmpeg (1) +completed successfully and, when enabled, the integrity check passed. Codec +skips, failed encodes, failed integrity checks, dry runs, and +.BR \-\-only\-if\-smaller +size skips leave the original file in place and create no backup. +.PP +The backup directory itself must already exist. Parent directories below it are +created as needed to preserve the input file path. If the intended backup file +already exists, a numeric suffix such as +.B .1 +or +.B .2 +is appended. .SH SIZE REPORT TSV When .BR \-\-size\-report @@ -369,6 +392,12 @@ Boolean. Equivalent to Defaults to .BR true . .TP +.B [encoding] backup_dir +String. Existing directory where originals are copied after successful +encoding and before replacement. Equivalent to +.BR \-\-backup\-dir . +CLI \fB--backup-dir\fR takes precedence. +.TP .B [skip] codecs Array of strings. Merged with any codecs from .BR \-S . |
