Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
759ac870
Commit
759ac870
authored
May 09, 2002
by
David Dykstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Submit enhancement from Michael Zimmerman to allow --suffix to be used
with --backup-dir.
parent
a1e0e45e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
NEWS
NEWS
+7
-2
backup.c
backup.c
+8
-2
options.c
options.c
+9
-1
rsync.yo
rsync.yo
+7
-2
No files found.
NEWS
View file @
759ac870
rsync changes since last release
ENHANCEMENTS:
* The --delete-after option now implies --delete. (Wayne Davison)
* The --suffix option can now be used with --backup-dir. (Michael
Zimmerman)
BUG FIXES:
* Fix "forward name lookup failed" errors on AIX 4.3.3. (John
...
...
@@ -15,8 +22,6 @@ rsync changes since last release
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=62489
* The --delete-after option now implies --delete.
INTERNAL:
* Many code cleanups and improved internal documentation. (Martin
...
...
backup.c
View file @
759ac870
...
...
@@ -21,6 +21,7 @@
#include "rsync.h"
extern
int
verbose
;
extern
int
suffix_specified
;
extern
char
*
backup_suffix
;
extern
char
*
backup_dir
;
...
...
@@ -203,12 +204,17 @@ static int keep_backup(char *fname)
if
(
!
file
)
return
1
;
/* make a complete pathname for backup file */
if
(
strlen
(
backup_dir
)
+
strlen
(
fname
)
>
(
MAXPATHLEN
-
1
))
{
if
(
strlen
(
backup_dir
)
+
strlen
(
fname
)
+
(
suffix_specified
?
strlen
(
backup_suffix
)
:
0
)
>
(
MAXPATHLEN
-
1
))
{
rprintf
(
FERROR
,
"keep_backup filename too long
\n
"
);
return
0
;
}
snprintf
(
keep_name
,
sizeof
(
keep_name
),
"%s/%s"
,
backup_dir
,
fname
);
if
(
suffix_specified
)
{
snprintf
(
keep_name
,
sizeof
(
keep_name
),
"%s/%s%s"
,
backup_dir
,
fname
,
backup_suffix
);
}
else
{
snprintf
(
keep_name
,
sizeof
(
keep_name
),
"%s/%s"
,
backup_dir
,
fname
);
}
#ifdef HAVE_MKNOD
...
...
options.c
View file @
759ac870
...
...
@@ -102,6 +102,7 @@ int no_detach = 0;
int
write_batch
=
0
;
int
read_batch
=
0
;
int
suffix_specified
=
0
;
char
*
backup_suffix
=
BACKUP_SUFFIX
;
char
*
tmpdir
=
NULL
;
...
...
@@ -296,7 +297,7 @@ enum {OPT_VERSION = 1000, OPT_SUFFIX, OPT_SENDER, OPT_SERVER, OPT_EXCLUDE,
static
struct
poptOption
long_options
[]
=
{
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
{
"version"
,
0
,
POPT_ARG_NONE
,
0
,
OPT_VERSION
,
0
,
0
},
{
"suffix"
,
0
,
POPT_ARG_STRING
,
&
backup_suffix
,
0
,
0
,
0
},
{
"suffix"
,
0
,
POPT_ARG_STRING
,
&
backup_suffix
,
OPT_SUFFIX
,
0
,
0
},
{
"rsync-path"
,
0
,
POPT_ARG_STRING
,
&
rsync_path
,
0
,
0
,
0
},
{
"password-file"
,
0
,
POPT_ARG_STRING
,
&
password_file
,
0
,
0
,
0
},
{
"ignore-times"
,
'I'
,
POPT_ARG_NONE
,
&
ignore_times
,
0
,
0
,
0
},
...
...
@@ -470,6 +471,13 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
print_rsync_version
(
FINFO
);
exit_cleanup
(
0
);
case
OPT_SUFFIX
:
/* The value has already been set by popt, but
* we need to remember that a suffix was specified
* in case a backup-directory is used. */
suffix_specified
=
1
;
break
;
case
OPT_MODIFY_WINDOW
:
/* The value has already been set by popt, but
* we need to remember that we're using a
...
...
rsync.yo
View file @
759ac870
...
...
@@ -226,7 +226,7 @@ verb(
-R, --relative use relative path names
-b, --backup make backups (default ~ suffix)
--backup-dir make backups into this directory
--suffix=SUFFIX
overrid
e backup suffix
--suffix=SUFFIX
defin
e backup suffix
-u, --update update only (don't overwrite newer files)
-l, --links copy symlinks as symlinks
-L, --copy-links copy the referent of symlinks
...
...
@@ -374,10 +374,15 @@ control the backup suffix using the --suffix option.
dit(bf(--backup-dir=DIR)) In combination with the --backup option, this
tells rsync to store all backups in the specified directory. This is
very useful for incremental backups.
very useful for incremental backups. You can additionally
specify a backup suffix using the --suffix option
(otherwise the files backed up in the specified directory
will keep their original filenames).
dit(bf(--suffix=SUFFIX)) This option allows you to override the default
backup suffix used with the -b option. The default is a ~.
If --backup-dir and --suffix are both specified,
the SUFFIX is appended to the filename even in the backup directory.
dit(bf(-u, --update)) This forces rsync to skip any files for which the
destination file already exists and has a date later than the source
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment