From cda2ae84b3b0f78387c5937094b4f5525c92fc19 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 31 Oct 1999 02:19:24 +0000 Subject: [PATCH] added "ignore errors" option in rsyncd.conf --- flist.c | 10 ++++++++-- loadparm.c | 4 ++++ receiver.c | 3 ++- rsyncd.conf.yo | 8 ++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/flist.c b/flist.c index 861fb2fe..b97c919e 100644 --- a/flist.c +++ b/flist.c @@ -769,7 +769,8 @@ struct file_list *send_file_list(int f,int argc,char *argv[]) /* if protocol version is >= 17 then send the io_error flag */ if (f != -1 && remote_version >= 17) { - write_int(f, io_error); + extern int module_id; + write_int(f, lp_ignore_errors(module_id)? 0 : io_error); } if (f != -1) { @@ -854,7 +855,12 @@ struct file_list *recv_file_list(int f) /* if protocol version is >= 17 then recv the io_error flag */ if (f != -1 && remote_version >= 17) { - io_error |= read_int(f); + extern int module_id; + if (lp_ignore_errors(module_id)) { + read_int(f); + } else { + io_error |= read_int(f); + } } if (list_only) { diff --git a/loadparm.c b/loadparm.c index 074e6cbf..2d65faaf 100644 --- a/loadparm.c +++ b/loadparm.c @@ -117,6 +117,7 @@ typedef struct BOOL list; BOOL use_chroot; BOOL transfer_logging; + BOOL ignore_errors; char *uid; char *gid; char *hosts_allow; @@ -147,6 +148,7 @@ static service sDefault = True, /* list */ True, /* use chroot */ False, /* transfer logging */ + False, /* ignore errors */ "nobody",/* uid */ "nobody",/* gid */ NULL, /* hosts allow */ @@ -272,6 +274,7 @@ static struct parm_struct parm_table[] = {"include", P_STRING, P_LOCAL, &sDefault.include, NULL, 0}, {"include from", P_STRING, P_LOCAL, &sDefault.include_from,NULL, 0}, {"transfer logging", P_BOOL, P_LOCAL, &sDefault.transfer_logging,NULL,0}, + {"ignore errors", P_BOOL, P_LOCAL, &sDefault.ignore_errors,NULL,0}, {"log format", P_STRING, P_LOCAL, &sDefault.log_format, NULL, 0}, {"refuse options", P_STRING, P_LOCAL, &sDefault.refuse_options,NULL, 0}, {"dont compress", P_STRING, P_LOCAL, &sDefault.dont_compress,NULL, 0}, @@ -336,6 +339,7 @@ FN_LOCAL_BOOL(lp_read_only, read_only) FN_LOCAL_BOOL(lp_list, list) FN_LOCAL_BOOL(lp_use_chroot, use_chroot) FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging) +FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors) FN_LOCAL_STRING(lp_uid, uid) FN_LOCAL_STRING(lp_gid, gid) FN_LOCAL_STRING(lp_hosts_allow, hosts_allow) diff --git a/receiver.c b/receiver.c index 6eb9acab..49d1bf22 100644 --- a/receiver.c +++ b/receiver.c @@ -109,11 +109,12 @@ static void delete_files(struct file_list *flist) struct file_list *local_file_list; int i, j; char *name; + extern int module_id; if (cvs_exclude) add_cvs_excludes(); - if (io_error) { + if (io_error && !lp_ignore_errors(module_id)) { rprintf(FINFO,"IO error encountered - skipping file deletion\n"); return; } diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo index bf0c68e2..3f6e01e4 100644 --- a/rsyncd.conf.yo +++ b/rsyncd.conf.yo @@ -274,6 +274,14 @@ rejected. See the "hosts allow" option for more information. The default is no "hosts deny" option, which means all hosts can connect. +dit(bf(ignore errors)) The "ignore errors" option tells rsyncd to +ignore IO errors on the server when deciding whether to run the delete +phase of the transfer. Normally rsync skips the --delete step if any +IO errors have occurred in order to prevent disasterous deletion due +to a temporary resource shortage or other IO error. In some cases this +test is counter productive so you can use this option to turn off this +behaviour. + dit(bf(transfer logging)) The "transfer logging" option enables per-file logging of downloads and uploads in a format somewhat similar to that used by ftp daemons. If you want to customize the log formats look at -- 2.34.1