diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/backup.c rsync-HEAD-20080303-1523GMT/backup.c --- rsync-HEAD-20080303-1523GMT_base/backup.c 2008-03-04 11:48:19.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/backup.c 2008-03-04 10:49:04.000000000 -0600 @@ -275,19 +275,11 @@ do_unlink(fname); } + // BOMBICH if (!kept && S_ISDIR(file->mode)) { - /* make an empty directory */ - if (do_mkdir(buf, file->mode) < 0 - && (errno != ENOENT || make_bak_dir(buf) < 0 - || do_mkdir(buf, file->mode) < 0)) { - rsyserr(FINFO, errno, "mkdir %s failed", - full_fname(buf)); - } - - ret_code = do_rmdir(fname); - if (verbose > 2) { - rprintf(FINFO, "make_backup: RMDIR %s returns %i\n", - full_fname(fname), ret_code); + if (robust_move(fname, buf) != 0) { + rsyserr(FERROR, errno, "keep_backup failed: %s -> \"%s\"", + full_fname(fname), full_fname(buf)); } kept = 1; } diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/config.h rsync-HEAD-20080303-1523GMT/config.h --- rsync-HEAD-20080303-1523GMT_base/config.h 2008-03-04 11:50:48.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/config.h 2008-03-04 10:49:04.000000000 -0600 @@ -172,7 +172,7 @@ #define HAVE_LANGINFO_H 1 /* Define to 1 if you have the `lchmod' function. */ -#define HAVE_LCHMOD 1 +/* #undef HAVE_LCHMOD */ /* Define to 1 if you have the `lchown' function. */ #define HAVE_LCHOWN 1 @@ -231,7 +231,7 @@ /* #undef HAVE_LSEEK64 */ /* Define to 1 if you have the `lutimes' function. */ -#define HAVE_LUTIMES 1 +/* #undef HAVE_LUTIMES */ /* Define to 1 if you have the `mallinfo' function. */ /* #undef HAVE_MALLINFO */ @@ -669,3 +669,6 @@ /* Define to `int' if doesn't define. */ /* #undef uid_t */ + +// BOMBICH +#define PARSEABLE_OUTPUT 1 diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/flist.c rsync-HEAD-20080303-1523GMT/flist.c --- rsync-HEAD-20080303-1523GMT_base/flist.c 2008-03-04 11:48:14.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/flist.c 2008-03-04 11:01:36.000000000 -0600 @@ -160,18 +160,30 @@ static void maybe_emit_filelist_progress(int count) { +// BOMBICH +#ifdef PARSEABLE_OUTPUT + if (!inc_recurse && xfer_dirs && !am_server && (count % 100) == 0) + rprintf(FINFO, "S;;;BFL;;;NOF;;;%d\n", count); +#else if (do_progress && show_filelist_p() && (count % 100) == 0) emit_filelist_progress(count); +#endif } static void finish_filelist_progress(const struct file_list *flist) { +// BOMBICH +#ifdef PARSEABLE_OUTPUT + if (!inc_recurse) + rprintf(FINFO, "S;;;FTC;;;NOF;;;%d;;;BT;;;%.3f\n", flist->used, (double)stats.flist_buildtime/1000); +#else if (do_progress) { /* This overwrites the progress line */ rprintf(FINFO, "%d file%sto consider\n", flist->used, flist->used == 1 ? " " : "s "); } else rprintf(FINFO, "done\n"); +#endif } void show_flist_stats(void) @@ -531,8 +543,11 @@ if (first_hlink_ndx >= 0) { write_varint(f, first_hlink_ndx); - if (first_hlink_ndx >= first_ndx) - goto the_end; + if (first_hlink_ndx >= first_ndx) { + // BOMBICH + stats.hard_links_not_copied++; + goto the_end; + } } write_varlong30(f, F_LENGTH(file), 3); @@ -580,6 +595,8 @@ if (!(xflags & XMIT_SAME_RDEV_pre28)) write_int(f, (int)rdev); } else { + // BOMBICH + stats.num_transferred_files++; if (!(xflags & XMIT_SAME_RDEV_MAJOR)) write_varint30(f, major(rdev)); if (protocol_version >= 30) @@ -593,6 +610,8 @@ #ifdef SUPPORT_LINKS if (preserve_links && S_ISLNK(mode)) { + // BOMBICH + stats.num_transferred_files++; const char *sl = F_SYMLINK(file); int len = strlen(sl); write_varint30(f, len); @@ -1334,6 +1353,19 @@ if (!file) return NULL; + // BOMBICH + if (S_ISDIR(file->mode)) + stats.num_dirs++; + else if (S_ISREG(file->mode)) + stats.num_reg_files++; + else if (S_ISLNK(file->mode)) + stats.num_symlinks++; + else if (IS_DEVICE(file->mode)) + stats.num_devices++; + else if (IS_SPECIAL(file->mode)) + stats.num_special++; + + if (chmod_modes && !S_ISLNK(file->mode)) file->mode = tweak_mode(file->mode, chmod_modes); @@ -1851,6 +1883,14 @@ else if (inc_recurse && verbose && !am_server) rprintf(FCLIENT, "sending incremental file list\n"); + // BOMBICH + stats.num_dirs = 0; + stats.num_reg_files = 0; + stats.num_symlinks = 0; + stats.num_devices = 0; + stats.num_special = 0; + stats.hard_links_not_copied = 0; + start_write = stats.total_written; gettimeofday(&start_tv, NULL); @@ -2072,7 +2112,10 @@ idev_destroy(); #endif +// BOMBICH +#ifndef PARSEABLE_OUTPUT if (show_filelist_p()) +#endif finish_filelist_progress(flist); gettimeofday(&end_tv, NULL); diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/generator.c rsync-HEAD-20080303-1523GMT/generator.c --- rsync-HEAD-20080303-1523GMT_base/generator.c 2008-03-04 11:48:19.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/generator.c 2008-03-04 11:03:36.000000000 -0600 @@ -121,6 +121,14 @@ static int need_retouch_dir_times; static int need_retouch_dir_perms; static const char *solo_file = NULL; + +// BOMBICH +struct timeval last_update; +static unsigned long msdiff(struct timeval *t1, struct timeval *t2) +{ + return (t2->tv_sec - t1->tv_sec) * 1000L + + (t2->tv_usec - t1->tv_usec) / 1000; +} /* For calling delete_item() and delete_dir_contents(). */ #define DEL_NO_UID_WRITE (1<<0) /* file/dir has our uid w/o write perm */ @@ -173,6 +181,12 @@ fbuf, (int)mode, (int)flags); } + // BOMBICH + if (S_ISDIR(mode) && make_backups > 0) { + ret = make_backup(fbuf); + goto check_ret; + } + if (flags & DEL_NO_UID_WRITE) do_chmod(fbuf, mode | S_IWUSR, NO_FFLAGS); @@ -530,7 +544,8 @@ /* If an item in dirlist is not found in flist, delete it * from the filesystem. */ - for (i = dirlist->used; i--; ) { + // BOMBICH + for (i = 0; i < dirlist->used; i++ ) { struct file_struct *fp = dirlist->files[i]; if (!F_IS_ACTIVE(fp)) continue; @@ -1735,6 +1750,25 @@ fnamecmp = fname; fnamecmp_type = FNAMECMP_FNAME; +// BOMBICH +#ifdef PARSEABLE_OUTPUT + struct timeval now; + gettimeofday(&now, NULL); + + // The Recv generator gets a list of every single file sent by the sender (whether it will) + // eventually copied or not. Here we optionally print out the current file that is being + // sent for consideration to give the user a general idea of where rsync is within their fs + + // Print update information every fifth of a second. If a file changed, print update + // information as long as the file is larger than 32K and time since last update > tenth of a second + unsigned long time_diff = msdiff(&last_update, &now); + int fileUnchanged = unchanged_file(fnamecmpbuf, file, &sx.st); + if ((fileUnchanged && (time_diff > 200)) || (!fileUnchanged && (file->len32 > 32768 || time_diff > 100))) { + last_update = now; + rprintf(FINFO, "S;;;SCAN;;;CF;;;%s\n", fname); + } +#endif + if (statret == 0 && !S_ISREG(sx.st.st_mode)) { if (delete_item(fname, sx.st.st_mode, del_opts | DEL_FOR_FILE) != 0) goto cleanup; diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/main.c rsync-HEAD-20080303-1523GMT/main.c --- rsync-HEAD-20080303-1523GMT_base/main.c 2008-03-01 14:01:41.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/main.c 2008-03-04 11:04:15.000000000 -0600 @@ -245,6 +245,13 @@ if (do_stats) { rprintf(FCLIENT, "\n"); rprintf(FINFO,"Number of files: %d\n", stats.num_files); + // BOMBICH + rprintf(FINFO,"Number of directories: %d\n", stats.num_dirs); + rprintf(FINFO,"Number of regular files: %d\n", stats.num_reg_files); + rprintf(FINFO,"Number of symlinks: %d\n", stats.num_symlinks); + rprintf(FINFO,"Number of devices: %d\n", stats.num_devices); + rprintf(FINFO,"Number of special files: %d\n", stats.num_special); + rprintf(FINFO,"Number of re-linked hard links: %d\n", stats.hard_links_not_copied); rprintf(FINFO,"Number of files transferred: %d\n", stats.num_transferred_files); rprintf(FINFO,"Total file size: %s bytes\n", diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/match.c rsync-HEAD-20080303-1523GMT/match.c --- rsync-HEAD-20080303-1523GMT_base/match.c 2008-03-01 14:01:41.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/match.c 2008-03-04 10:49:04.000000000 -0600 @@ -39,6 +39,15 @@ extern struct stats stats; +// BOMBICH +struct timeval last_update; +static unsigned long msdiff(struct timeval *t1, struct timeval *t2) +{ + return (t2->tv_sec - t1->tv_sec) * 1000L + + (t2->tv_usec - t1->tv_usec) / 1000; +} + + #define TRADITIONAL_TABLESIZE (1<<16) static uint32 tablesize; @@ -135,6 +144,19 @@ if (buf && do_progress) show_progress(last_match, buf->file_size); + +// BOMBICH +#ifdef PARSEABLE_OUTPUT + if (buf) { + struct timeval now; + gettimeofday(&now, NULL); + unsigned long time_diff = msdiff(&last_update, &now); + if (time_diff > 1000) { + last_update = now; + rprintf(FINFO, "S;;;CPUPD;;;TTS;;;%.0llu\n", stats.total_transferred_size - buf->file_size + offset); + } + } +#endif } diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/rounding.h rsync-HEAD-20080303-1523GMT/rounding.h --- rsync-HEAD-20080303-1523GMT_base/rounding.h 1969-12-31 18:00:00.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/rounding.h 2008-03-04 10:49:04.000000000 -0600 @@ -0,0 +1 @@ +#define EXTRA_ROUNDING 0 diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/rsync.h rsync-HEAD-20080303-1523GMT/rsync.h --- rsync-HEAD-20080303-1523GMT_base/rsync.h 2008-03-04 11:48:14.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/rsync.h 2008-03-04 11:04:50.000000000 -0600 @@ -851,6 +851,13 @@ int64 flist_size; int num_files; int num_transferred_files; + // BOMBICH + int num_dirs; + int num_reg_files; + int num_symlinks; + int num_devices; + int num_special; + int hard_links_not_copied; }; struct chmod_mode_struct; diff -Naur -X rsync3/_build/diff_ignore rsync-HEAD-20080303-1523GMT_base/sender.c rsync-HEAD-20080303-1523GMT/sender.c --- rsync-HEAD-20080303-1523GMT_base/sender.c 2008-03-01 14:01:41.000000000 -0600 +++ rsync-HEAD-20080303-1523GMT/sender.c 2008-03-04 11:07:43.000000000 -0600 @@ -46,6 +46,16 @@ extern struct stats stats; extern struct file_list *cur_flist, *first_flist, *dir_flist; +// BOMBICH +#ifdef PARSEABLE_OUTPUT +struct timeval last_update; +static unsigned long msdiff(struct timeval *t1, struct timeval *t2) +{ + return (t2->tv_sec - t1->tv_sec) * 1000L + + (t2->tv_usec - t1->tv_usec) / 1000; +} +#endif + /** * @file * @@ -237,6 +247,9 @@ maybe_log_item(file, iflags, itemizing, xname); write_ndx_and_attrs(f_out, ndx, iflags, fname, file, fnamecmp_type, xname, xlen); + // BOMBICH + if (S_ISREG(file->mode)) + rprintf(FINFO, "Didn't transfer %s\n", fname); continue; } if (phase == 2) { @@ -269,6 +282,28 @@ set_current_file_index(file, ndx); stats.num_transferred_files++; stats.total_transferred_size += F_LENGTH(file); +// BOMBICH +#ifdef PARSEABLE_OUTPUT + if (inc_recurse) { + struct timeval now; + gettimeofday(&now, NULL); + unsigned long time_diff = msdiff(&last_update, &now); + if (time_diff > 100) { + last_update = now; + if (inc_recurse) + rprintf(FINFO, "S;;;CP;;;FC;;;%d;;;NOF;;;%d\n", stats.num_transferred_files, stats.num_files - stats.num_dirs); + else + rprintf(FINFO, "S;;;CP;;;FC;;;%d;;;IDX;;;%d\n", stats.num_transferred_files, ndx); + +// snprintf(eol, sizeof eol, " (xfer#%d, to-check=%d/%d)\n", +// stats.num_transferred_files, +// stats.num_files - current_file_index - 1, +// stats.num_files); + + + } + } +#endif if (!do_xfers) { /* log the transfer */ log_item(FCLIENT, file, &stats, iflags, NULL); @@ -373,5 +408,10 @@ match_report(); +// BOMBICH +#ifdef PARSEABLE_OUTPUT + rprintf(FINFO, "S;;;CPUPD;;;TTS;;;%.0llu\n", stats.total_transferred_size); +#endif + write_ndx(f_out, NDX_DONE); }