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
ef5d23eb
Commit
ef5d23eb
authored
Jun 06, 2000
by
David Dykstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --bwlimit option contributed by Matthew Demicco and Jamie Gritton.
parent
27b9a19b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletion
+39
-1
io.c
io.c
+15
-0
options.c
options.c
+15
-1
rsync.yo
rsync.yo
+9
-0
No files found.
io.c
View file @
ef5d23eb
...
...
@@ -27,6 +27,8 @@
/* if no timeout is specified then use a 60 second select timeout */
#define SELECT_TIMEOUT 60
extern
int
bwlimit
;
static
int
io_multiplexing_out
;
static
int
io_multiplexing_in
;
static
int
multiplex_in_fd
;
...
...
@@ -388,6 +390,19 @@ static void writefd_unbuffered(int fd,char *buf,int len)
exit_cleanup
(
RERR_STREAMIO
);
}
/* Sleep after writing to limit I/O bandwidth */
if
(
bwlimit
)
{
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
ret
*
1000
/
bwlimit
;
while
(
tv
.
tv_usec
>
1000000
)
{
tv
.
tv_sec
++
;
tv
.
tv_usec
-=
1000000
;
}
select
(
0
,
NULL
,
NULL
,
NULL
,
&
tv
);
}
total
+=
ret
;
if
(
io_timeout
)
...
...
options.c
View file @
ef5d23eb
...
...
@@ -62,6 +62,7 @@ int safe_symlinks=0;
int
copy_unsafe_links
=
0
;
int
block_size
=
BLOCK_SIZE
;
int
size_only
=
0
;
int
bwlimit
=
0
;
int
delete_after
=
0
;
int
only_existing
=
0
;
int
max_delete
=
0
;
...
...
@@ -159,6 +160,7 @@ void usage(enum logcode F)
rprintf
(
F
,
" --progress show progress during transfer
\n
"
);
rprintf
(
F
,
" --log-format=FORMAT log file transfers using specified format
\n
"
);
rprintf
(
F
,
" --password-file=FILE get password from FILE
\n
"
);
rprintf
(
F
,
" --bwlimit=KBPS limit I/O bandwidth, KBytes per second
\n
"
);
rprintf
(
F
,
" -h, --help show this help screen
\n
"
);
rprintf
(
F
,
"
\n
"
);
...
...
@@ -174,7 +176,7 @@ enum {OPT_VERSION, OPT_SUFFIX, OPT_SENDER, OPT_SERVER, OPT_EXCLUDE,
OPT_COPY_UNSAFE_LINKS
,
OPT_SAFE_LINKS
,
OPT_COMPARE_DEST
,
OPT_LOG_FORMAT
,
OPT_PASSWORD_FILE
,
OPT_SIZE_ONLY
,
OPT_ADDRESS
,
OPT_DELETE_AFTER
,
OPT_EXISTING
,
OPT_MAX_DELETE
,
OPT_BACKUP_DIR
,
OPT_IGNORE_ERRORS
};
OPT_IGNORE_ERRORS
,
OPT_BWLIMIT
};
static
char
*
short_options
=
"oblLWHpguDCtcahvqrRIxnSe:B:T:zP"
;
...
...
@@ -235,6 +237,7 @@ static struct option long_options[] = {
{
"config"
,
1
,
0
,
OPT_CONFIG
},
{
"port"
,
1
,
0
,
OPT_PORT
},
{
"log-format"
,
1
,
0
,
OPT_LOG_FORMAT
},
{
"bwlimit"
,
1
,
0
,
OPT_BWLIMIT
},
{
"address"
,
1
,
0
,
OPT_ADDRESS
},
{
"max-delete"
,
1
,
0
,
OPT_MAX_DELETE
},
{
"backup-dir"
,
1
,
0
,
OPT_BACKUP_DIR
},
...
...
@@ -552,6 +555,10 @@ int parse_arguments(int argc, char *argv[], int frommain)
case
OPT_LOG_FORMAT
:
log_format
=
optarg
;
break
;
case
OPT_BWLIMIT
:
bwlimit
=
atoi
(
optarg
);
break
;
case
OPT_ADDRESS
:
{
...
...
@@ -584,6 +591,8 @@ void server_options(char **args,int *argc)
static
char
bsize
[
30
];
static
char
iotime
[
30
];
static
char
mdelete
[
30
];
static
char
bw
[
50
];
int
i
,
x
;
args
[
ac
++
]
=
"--server"
;
...
...
@@ -655,6 +664,11 @@ void server_options(char **args,int *argc)
args
[
ac
++
]
=
iotime
;
}
if
(
bwlimit
)
{
slprintf
(
bw
,
sizeof
(
bw
),
"--bwlimit=%d"
,
bwlimit
);
args
[
ac
++
]
=
bw
;
}
if
(
strcmp
(
backup_suffix
,
BACKUP_SUFFIX
))
{
args
[
ac
++
]
=
"--suffix"
;
args
[
ac
++
]
=
backup_suffix
;
...
...
rsync.yo
View file @
ef5d23eb
...
...
@@ -273,6 +273,7 @@ verb(
--progress show progress during transfer
--log-format=FORMAT log file transfers using specified format
--password-file=FILE get password from FILE
--bwlimit=KBPS limit I/O bandwidth, KBytes per second
-h, --help show this help screen
)
...
...
@@ -643,6 +644,14 @@ transport, not when using a remote shell as the transport. The file
must not be world readable. It should contain just the password as a
single line.
dit(bf(--bwlimit=KBPS)) This option allows you to specify a maximum
transfer rate in kilobytes per second. This option is most effective when
using rsync with large files (several megabytes and up). Due to the nature
of rsync transfers, blocks of data are sent, then if rsync determines the
transfer was too fast, it will wait before sending the next data block. The
result is an average transfer rate equalling the specified limit. A value
of zero specifies no limit.
enddit()
manpagesection(EXCLUDE PATTERNS)
...
...
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