diff --git a/doc/ChangeLog b/doc/ChangeLog index 2b8d0701..a67cfc28 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2013-07-09 Giuseppe Scrivano + + * wget.texi (Download Options): Add documentation for --backups. + (Wgetrc Commands): Add documentation for backups. + Reported by: Tomas Hozza . + 2013-07-11 Tomas Hozza * wget.texi: Document --regex-type and --preserve-permissions. diff --git a/doc/wget.texi b/doc/wget.texi index 5054382d..7a1670ef 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -630,6 +630,13 @@ Note that when @samp{-nc} is specified, files with the suffixes @samp{.html} or @samp{.htm} will be loaded from the local disk and parsed as if they had been retrieved from the Web. +@cindex backing up files +@item --backups=@var{backups} +Before (over)writing a file, back up an existing file by adding a +@samp{.1} suffix (@samp{_1} on VMS) to the file name. Such backup +files are rotated to @samp{.2}, @samp{.3}, and so on, up to +@var{backups} (and lost beyond that). + @cindex continue retrieval @cindex incomplete downloads @cindex resume download @@ -2882,9 +2889,11 @@ enables it). Enable/disable saving pre-converted files with the suffix @samp{.orig}---the same as @samp{-K} (which enables it). -@c @item backups = @var{number} -@c #### Document me! -@c +@item backups = @var{number} +Use up to @var{number} backups for a file. Backups are rotated by +adding an incremental counter that starts at @samp{1}. The default is +@samp{0}. + @item base = @var{string} Consider relative @sc{url}s in input files (specified via the @samp{input} command or the @samp{--input-file}/@samp{-i} option, diff --git a/src/main.c b/src/main.c index c895c4ee..8ce0eb3f 100644 --- a/src/main.c +++ b/src/main.c @@ -714,6 +714,9 @@ Recursive download:\n"), N_("\ -k, --convert-links make links in downloaded HTML or CSS point to\n\ local files.\n"), + N_("\ + --backups=N before writing file X, rotate up to N backup files.\n"), + #ifdef __VMS N_("\ -K, --backup-converted before converting file X, back up as X_orig.\n"),