1 --- orig/generator.c 2004-07-28 10:05:29
2 +++ generator.c 2004-07-03 20:20:46
3 @@ -39,6 +39,7 @@ extern int opt_ignore_existing;
4 extern int csum_length;
5 extern int ignore_times;
7 +extern OFF_T max_size;
9 extern int protocol_version;
10 extern int always_checksum;
11 @@ -336,6 +337,10 @@ static void recv_generator(char *fname,
12 && verbose && f_out != -1)
13 rprintf(FINFO, "%s/\n", safe_fname(fname));
15 + } else if (max_size && file->length > max_size) {
17 + rprintf(FINFO, "%s is over max-size\n", fname);
21 if (preserve_links && S_ISLNK(file->mode)) {
22 --- orig/options.c 2004-07-23 17:16:13
23 +++ options.c 2004-07-15 02:34:44
24 @@ -90,6 +90,7 @@ int delete_after = 0;
25 int only_existing = 0;
26 int opt_ignore_existing = 0;
29 int ignore_errors = 0;
30 int modify_window = 0;
32 @@ -139,6 +140,7 @@ char *batch_name = NULL;
34 static int daemon_opt; /* sets am_daemon after option error-reporting */
35 static int modify_window_set;
36 +static char *max_size_arg;
38 /** Local address to bind. As a character string because it's
39 * interpreted by the IPv6 layer: should be a numeric IP4 or IP6
40 @@ -267,6 +269,7 @@ void usage(enum logcode F)
41 rprintf(F," --delete-after receiver deletes after transferring, not before\n");
42 rprintf(F," --ignore-errors delete even if there are I/O errors\n");
43 rprintf(F," --max-delete=NUM don't delete more than NUM files\n");
44 + rprintf(F," --max-size=SIZE don't transfer any file larger than SIZE\n");
45 rprintf(F," --partial keep partially transferred files\n");
46 rprintf(F," --force force deletion of directories even if not empty\n");
47 rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n");
48 @@ -317,7 +320,7 @@ void usage(enum logcode F)
49 enum {OPT_VERSION = 1000, OPT_SENDER, OPT_EXCLUDE, OPT_EXCLUDE_FROM,
50 OPT_DELETE_AFTER, OPT_DELETE_EXCLUDED, OPT_LINK_DEST,
51 OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_MODIFY_WINDOW,
52 - OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT,
53 + OPT_READ_BATCH, OPT_WRITE_BATCH, OPT_TIMEOUT, OPT_MAX_SIZE,
54 OPT_REFUSED_BASE = 9000};
56 static struct poptOption long_options[] = {
57 @@ -372,6 +375,7 @@ static struct poptOption long_options[]
58 {"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
59 {"block-size", 'B', POPT_ARG_INT, &block_size, 0, 0, 0 },
60 {"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 },
61 + {"max-size", 0, POPT_ARG_STRING, &max_size_arg, OPT_MAX_SIZE, 0, 0 },
62 {"timeout", 0, POPT_ARG_INT, &io_timeout, OPT_TIMEOUT, 0, 0 },
63 {"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
64 {"compare-dest", 0, POPT_ARG_STRING, &compare_dest, 0, 0, 0 },
65 @@ -586,6 +590,32 @@ int parse_arguments(int *argc, const cha
70 + for (arg = max_size_arg; isdigit(*arg); arg++) {}
72 + for (arg++; isdigit(*arg); arg++) {}
73 + if (arg == max_size_arg)
77 + max_size = atof(max_size_arg) * 1024;
80 + max_size = atof(max_size_arg) * 1024*1024;
83 + max_size = atof(max_size_arg) * 1024*1024*1024;
89 + "--max-size value is invalid.\n");
90 + exit_cleanup(RERR_SYNTAX);
96 if (io_timeout && io_timeout < select_timeout)
97 select_timeout = io_timeout;
98 @@ -924,6 +954,11 @@ void server_options(char **args,int *arg
102 + if (max_size && am_sender) {
103 + args[ac++] = "--max-size";
104 + args[ac++] = max_size_arg;
108 if (asprintf(&arg, "--timeout=%d", io_timeout) < 0)
110 --- orig/rsync.yo 2004-07-24 16:52:10
111 +++ rsync.yo 2004-07-03 20:20:46
112 @@ -316,6 +316,7 @@ verb(
113 --delete-after receiver deletes after transfer, not before
114 --ignore-errors delete even if there are I/O errors
115 --max-delete=NUM don't delete more than NUM files
116 + --max-size=SIZE don't transfer any file larger than SIZE
117 --partial keep partially transferred files
118 --force force deletion of dirs even if not empty
119 --numeric-ids don't map uid/gid values by user/group name
120 @@ -592,6 +593,11 @@ dit(bf(--max-delete=NUM)) This tells rsy
121 files or directories. This is useful when mirroring very large trees
122 to prevent disasters.
124 +dit(bf(--max-size=SIZE)) This tells rsync to avoid transferring any
125 +file that is larger than the specified SIZE. The SIZE value can be
126 +suffixed with a letter to indicate a size multiplier (K, M, or G) and
127 +may be a fractional value (e.g. "--max-size=1.5m").
129 dit(bf(--delete)) This tells rsync to delete any files on the receiving
130 side that aren't on the sending side. Files that are excluded from
131 transfer are excluded from being deleted unless you use --delete-excluded.