added "ignore errors" option in rsyncd.conf
authorAndrew Tridgell <tridge@samba.org>
Sun, 31 Oct 1999 02:19:24 +0000 (02:19 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 31 Oct 1999 02:19:24 +0000 (02:19 +0000)
flist.c
loadparm.c
receiver.c
rsyncd.conf.yo

diff --git a/flist.c b/flist.c
index 861fb2fee40ed64b097117c12a258a57d3d4f19c..b97c919eefd03bf5dde3e8579d63defefb33fe26 100644 (file)
--- 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) {
 
        /* 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) {
        }
 
        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) {
 
   /* 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) {
   }
 
   if (list_only) {
index 074e6cbf938941da60d297d1f95f38cf78a27127..2d65faafe37647373ef9cb419c2bb5ac30bff337 100644 (file)
@@ -117,6 +117,7 @@ typedef struct
        BOOL list;
        BOOL use_chroot;
        BOOL transfer_logging;
        BOOL list;
        BOOL use_chroot;
        BOOL transfer_logging;
+       BOOL ignore_errors;
        char *uid;
        char *gid;
        char *hosts_allow;
        char *uid;
        char *gid;
        char *hosts_allow;
@@ -147,6 +148,7 @@ static service sDefault =
        True,    /* list */
        True,    /* use chroot */
        False,   /* transfer logging */
        True,    /* list */
        True,    /* use chroot */
        False,   /* transfer logging */
+       False,   /* ignore errors */
        "nobody",/* uid */
        "nobody",/* gid */
        NULL,    /* hosts allow */
        "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},
   {"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},
   {"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_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)
 FN_LOCAL_STRING(lp_uid, uid)
 FN_LOCAL_STRING(lp_gid, gid)
 FN_LOCAL_STRING(lp_hosts_allow, hosts_allow)
index 6eb9acab044969aff2bc377d283540c7841f1aeb..49d1bf2279d4a9b2b9f77db12dd38c7050c51303 100644 (file)
@@ -109,11 +109,12 @@ static void delete_files(struct file_list *flist)
        struct file_list *local_file_list;
        int i, j;
        char *name;
        struct file_list *local_file_list;
        int i, j;
        char *name;
+       extern int module_id;
 
        if (cvs_exclude)
                add_cvs_excludes();
 
 
        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;
        }
                rprintf(FINFO,"IO error encountered - skipping file deletion\n");
                return;
        }
index bf0c68e27c6ea6c59b4f47b3634643cf2f30447e..3f6e01e4002b6eec5119b38990cc9cf77725470f 100644 (file)
@@ -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.
 
 
 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
 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