int preserve_links = 0;
int preserve_hard_links = 0;
int preserve_perms = 0;
+int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
int preserve_uid = 0;
int force_delete = 0;
int io_timeout = 0;
int allowed_lull = 0;
-int skip_empty_dirs = 0;
+int prune_empty_dirs = 0;
char *files_from = NULL;
int filesfrom_fd = -1;
char *filesfrom_host = NULL;
static int refused_partial, refused_progress, refused_delete_before;
static int refused_inplace;
static char *max_size_arg, *min_size_arg;
-static char partialdir_for_delayupdate[] = ".~tmp~";
+static char tmp_partialdir[] = ".~tmp~";
/** Local address to bind. As a character string because it's
* interpreted by the IPv6 layer: should be a numeric IP4 or IP6
rprintf(F," -H, --hard-links preserve hard links\n");
rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n");
rprintf(F," -p, --perms preserve permissions\n");
+ rprintf(F," --chmod=CHMOD change destination permissions\n");
+ rprintf(F," -E, --executability preserve the file's executability\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
rprintf(F," --devices preserve device files (super-user only)\n");
rprintf(F," -t, --times preserve times\n");
rprintf(F," -O, --omit-dir-times omit directories when preserving times\n");
rprintf(F," --super receiver attempts super-user activities\n");
- rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
rprintf(F," -W, --whole-file copy files whole (without rsync algorithm)\n");
rprintf(F," --partial keep partially transferred files\n");
rprintf(F," --partial-dir=DIR put a partially transferred file into DIR\n");
rprintf(F," --delay-updates put all updated files into place at transfer's end\n");
- rprintf(F," -k, --skip-empty-dirs skip empty directory chains\n");
+ rprintf(F," -m, --prune-empty-dirs prune empty directory chains from the file-list\n");
rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n");
rprintf(F," --timeout=TIME set I/O timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
{"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 },
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
+ {"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-partial", 0, POPT_ARG_VAL, &keep_partial, 0, 0, 0 },
{"partial-dir", 0, POPT_ARG_STRING, &partial_dir, 0, 0, 0 },
{"delay-updates", 0, POPT_ARG_NONE, &delay_updates, 0, 0, 0 },
- {"skip-empty-dirs", 'k', POPT_ARG_NONE, &skip_empty_dirs, 0, 0, 0 },
+ {"prune-empty-dirs",'m', POPT_ARG_NONE, &prune_empty_dirs, 0, 0, 0 },
{"log-format", 0, POPT_ARG_STRING, &log_format, 0, 0, 0 },
{"itemize-changes", 'i', POPT_ARG_NONE, 0, 'i', 0, 0 },
{"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 },
case OPT_CHMOD:
arg = poptGetOptArg(pc);
- if (!(chmod_modes = parse_chmod(arg, chmod_modes))) {
+ if (!parse_chmod(arg, &chmod_modes)) {
snprintf(err_buf, sizeof err_buf,
"Invalid argument passed to --chmod (%s)\n",
arg);
snprintf(err_buf, sizeof err_buf,
"--suffix cannot be a null string without --backup-dir\n");
return 0;
- } else if (delete_mode && !delete_excluded) {
+ } else if (make_backups && delete_mode && !delete_excluded) {
snprintf(backup_dir_buf, sizeof backup_dir_buf,
"P *%s", backup_suffix);
parse_rule(&filter_list, backup_dir_buf, 0, 0);
}
if (delay_updates && !partial_dir)
- partial_dir = partialdir_for_delayupdate;
+ partial_dir = tmp_partialdir;
if (inplace) {
#ifdef HAVE_FTRUNCATE
if (am_sender) {
if (keep_dirlinks)
argstr[x++] = 'K';
- if (skip_empty_dirs)
- argstr[x++] = 'k';
+ if (prune_empty_dirs)
+ argstr[x++] = 'm';
if (omit_dir_times == 2)
argstr[x++] = 'O';
}
argstr[x++] = 't';
if (preserve_perms)
argstr[x++] = 'p';
+ else if (preserve_executability && am_sender)
+ argstr[x++] = 'E';
if (recurse)
argstr[x++] = 'r';
if (always_checksum)
}
if (partial_dir && am_sender) {
- if (partial_dir != partialdir_for_delayupdate) {
+ if (partial_dir != tmp_partialdir) {
args[ac++] = "--partial-dir";
args[ac++] = partial_dir;
}
if (delay_updates)
args[ac++] = "--delay-updates";
- } else if (keep_partial)
+ } else if (keep_partial && am_sender)
args[ac++] = "--partial";
if (ignore_errors)
else if (inplace)
args[ac++] = "--inplace";
- if (tmpdir) {
+ if (tmpdir && am_sender) {
args[ac++] = "--temp-dir";
args[ac++] = tmpdir;
}