Skip to content
Permalink
Browse files

progress: add --progress option to set timeout

Signed-off-by: Adam Moody <moody20@llnl.gov>
  • Loading branch information...
adammoody committed May 15, 2019
1 parent dffbe9a commit ee5befc8790076406be3b8a12a77f9b685d6bcdb
Showing with 114 additions and 0 deletions.
  1. +6 −0 doc/rst/dchmod.1.rst
  2. +6 −0 doc/rst/dcmp.1.rst
  3. +6 −0 doc/rst/dcp.1.rst
  4. +6 −0 doc/rst/drm.1.rst
  5. +6 −0 doc/rst/dstripe.1.rst
  6. +6 −0 doc/rst/dsync.1.rst
  7. +13 −0 src/dchmod/dchmod.c
  8. +13 −0 src/dcmp/dcmp.c
  9. +13 −0 src/dcp/dcp.c
  10. +13 −0 src/drm/drm.c
  11. +13 −0 src/dstripe/dstripe.c
  12. +13 −0 src/dsync/dsync.c
@@ -55,6 +55,12 @@ OPTIONS
Change --exclude and --match to apply to item name rather than its
full path.

.. option:: --progress N

Print progress message to stdout approximately every N seconds.
The number of seconds must be a non-negative integer.
A value of 0 disables progress messages.

.. option:: -v, --verbose

Run in verbose mode. Prints a list of statistics including the
@@ -36,6 +36,12 @@ OPTIONS

Enable base checks and normal stdout results when --output is used.

.. option:: --progress N

Print progress message to stdout approximately every N seconds.
The number of seconds must be a non-negative integer.
A value of 0 disables progress messages.

.. option:: -v, --verbose

Run in verbose mode. Prints a list of statistics/timing data for the
@@ -36,6 +36,12 @@ OPTIONS

Create sparse files when possible (non-functioning).

.. option:: --progress N

Print progress message to stdout approximately every N seconds.
The number of seconds must be a non-negative integer.
A value of 0 disables progress messages.

.. option:: -v, --verbose

Run in verbose mode.
@@ -68,6 +68,12 @@ OPTIONS

Delete child items without updating the mtime on their parent directory.

.. option:: --progress N

Print progress message to stdout approximately every N seconds.
The number of seconds must be a non-negative integer.
A value of 0 disables progress messages.

.. option:: -v, --verbose

Run in verbose mode.
@@ -46,6 +46,12 @@ OPTIONS
Display the file size, stripe count, and stripe size of all files
found in PATH. No restriping is performed when using this option.

.. option:: --progress N

Print progress message to stdout approximately every N seconds.
The number of seconds must be a non-negative integer.
A value of 0 disables progress messages.

.. option:: -v, --verbose

Run in verbose mode.
@@ -35,6 +35,12 @@ OPTIONS

Delete extraneous files from destination.

.. option:: --progress N

Print progress message to stdout approximately every N seconds.
The number of seconds must be a non-negative integer.
A value of 0 disables progress messages.

.. option:: -v, --verbose

Run in verbose mode. Prints a list of statistics/timing data for the
@@ -34,6 +34,7 @@ static void print_usage(void)
printf(" --exclude <regex> - exclude a list of files from command\n");
printf(" --match <regex> - match a list of files from command\n");
printf(" -n, --name - exclude a list of files from command\n");
printf(" --progress <N> - print progress every N seconds\n");
printf(" -v, --verbose - verbose output\n");
printf(" -q, --quiet - quiet output\n");
printf(" -h, --help - print usage\n");
@@ -80,6 +81,7 @@ int main(int argc, char** argv)
{"exclude", 1, 0, 'e'},
{"match", 1, 0, 'a'},
{"name", 0, 0, 'n'},
{"progress", 1, 0, 'P'},
{"verbose", 0, 0, 'v'},
{"quiet", 0, 0, 'q'},
{"help", 0, 0, 'h'},
@@ -121,6 +123,9 @@ int main(int argc, char** argv)
case 'n':
name = 1;
break;
case 'P':
mfu_progress_timeout = atoi(optarg);
break;
case 'v':
mfu_debug_level = MFU_LOG_VERBOSE;
break;
@@ -140,6 +145,14 @@ int main(int argc, char** argv)
}
}

/* check that we got a valid progress value */
if (mfu_progress_timeout < 0) {
if (rank == 0) {
MFU_LOG(MFU_LOG_ERR, "Seconds in --progress must be non-negative: %d invalid", mfu_progress_timeout);
}
usage = 1;
}

/* paths to walk come after the options */
int numpaths = 0;
mfu_param_path* paths = NULL;
@@ -30,6 +30,7 @@ static void print_usage(void)
printf(" -o, --output <EXPR:FILE> - write list of entries matching EXPR to FILE\n");
printf(" -t, --text - change output option to write in text format\n");
printf(" -b, --base - enable base checks and normal output with --output\n");
printf(" --progress <N> - print progress every N seconds\n");
printf(" -v, --verbose - verbose output\n");
printf(" -q, --quiet - quiet output\n");
printf(" -l, --lite - only compares file modification time and size\n");
@@ -2059,6 +2060,7 @@ int main(int argc, char **argv)
{"output", 1, 0, 'o'},
{"text", 0, 0, 't'},
{"base", 0, 0, 'b'},
{"progress", 1, 0, 'P'},
{"verbose", 0, 0, 'v'},
{"quiet", 0, 0, 'q'},
{"lite", 0, 0, 'l'},
@@ -2095,6 +2097,9 @@ int main(int argc, char **argv)
case 'b':
options.base++;
break;
case 'P':
mfu_progress_timeout = atoi(optarg);
break;
case 'v':
options.verbose++;
mfu_debug_level = MFU_LOG_VERBOSE;
@@ -2120,6 +2125,14 @@ int main(int argc, char **argv)
}
}

/* check that we got a valid progress value */
if (mfu_progress_timeout < 0) {
if (rank == 0) {
MFU_LOG(MFU_LOG_ERR, "Seconds in --progress must be non-negative: %d invalid", mfu_progress_timeout);
}
usage = 1;
}

/* Generate default output */
if (options.base || list_empty(&options.outputs)) {
/*
@@ -69,6 +69,7 @@ void print_usage(void)
printf(" -p, --preserve - preserve permissions, ownership, timestamps, extended attributes\n");
printf(" -s, --synchronous - use synchronous read/write calls (O_DIRECT)\n");
printf(" -S, --sparse - create sparse files when possible\n");
printf(" --progress <N> - print progress every N seconds\n");
printf(" -v, --verbose - verbose output\n");
printf(" -q, --quiet - quiet output\n");
printf(" -h, --help - print usage\n");
@@ -114,6 +115,7 @@ int main(int argc, char** argv)
{"preserve" , no_argument , 0, 'p'},
{"synchronous" , no_argument , 0, 's'},
{"sparse" , no_argument , 0, 'S'},
{"progress" , required_argument, 0, 'P'},
{"verbose" , no_argument , 0, 'v'},
{"quiet" , no_argument , 0, 'q'},
{"help" , no_argument , 0, 'h'},
@@ -209,6 +211,9 @@ int main(int argc, char** argv)
MFU_LOG(MFU_LOG_INFO, "Using sparse file");
}
break;
case 'P':
mfu_progress_timeout = atoi(optarg);
break;
case 'v':
mfu_debug_level = MFU_LOG_VERBOSE;
break;
@@ -228,6 +233,14 @@ int main(int argc, char** argv)
}
}

/* check that we got a valid progress value */
if (mfu_progress_timeout < 0) {
if (rank == 0) {
MFU_LOG(MFU_LOG_ERR, "Seconds in --progress must be non-negative: %d invalid", mfu_progress_timeout);
}
usage = 1;
}

/* paths to walk come after the options */
int numpaths = 0;
int numpaths_src = 0;
@@ -39,6 +39,7 @@ static void print_usage(void)
printf(" --dryrun - print out list of files that would be deleted\n");
printf(" --aggressive - aggressive mode deletes files during the walk. You CANNOT use dryrun with this option. \n");
printf(" -T, --traceless - remove child items without changing parent directory mtime\n");
printf(" --progress <N> - print progress every N seconds\n");
printf(" -v, --verbose - verbose output\n");
printf(" -q, --quiet - quiet output\n");
printf(" -h, --help - print usage\n");
@@ -88,6 +89,7 @@ int main(int argc, char** argv)
{"dryrun", 0, 0, 'd'},
{"aggressive", 0, 0, 'A'},
{"traceless", 0, 0, 'T'},
{"progress", 1, 0, 'P'},
{"verbose", 0, 0, 'v'},
{"quiet", 0, 0, 'q'},
{"help", 0, 0, 'h'},
@@ -141,6 +143,9 @@ int main(int argc, char** argv)
case 'T':
traceless = 1;
break;
case 'P':
mfu_progress_timeout = atoi(optarg);
break;
case 'v':
mfu_debug_level = MFU_LOG_VERBOSE;
break;
@@ -167,6 +172,14 @@ int main(int argc, char** argv)
return 1;
}

/* check that we got a valid progress value */
if (mfu_progress_timeout < 0) {
if (rank == 0) {
MFU_LOG(MFU_LOG_ERR, "Seconds in --progress must be non-negative: %d invalid", mfu_progress_timeout);
}
usage = 1;
}

/* paths to walk come after the options */
int numpaths = 0;
mfu_param_path* paths = NULL;
@@ -101,6 +101,7 @@ static void print_usage(void)
printf(" -s, --size <SIZE> - stripe size in bytes (default 1MB)\n");
printf(" -m, --minsize <SIZE> - minimum file size (default 0MB)\n");
printf(" -r, --report - display file size and stripe info\n");
printf(" --progress <N> - print progress every N seconds\n");
printf(" -v, --verbose - verbose output\n");
printf(" -q, --quiet - quiet output\n");
printf(" -h, --help - print usage\n");
@@ -427,6 +428,7 @@ int main(int argc, char* argv[])
{"size", 1, 0, 's'},
{"minsize", 1, 0, 'm'},
{"report", 0, 0, 'r'},
{"progress", 1, 0, 'P'},
{"verbose", 0, 0, 'v'},
{"quiet", 0, 0, 'q'},
{"help", 0, 0, 'h'},
@@ -472,6 +474,9 @@ int main(int argc, char* argv[])
/* report striping info */
report = 1;
break;
case 'P':
mfu_progress_timeout = atoi(optarg);
break;
case 'v':
mfu_debug_level = MFU_LOG_VERBOSE;
break;
@@ -493,6 +498,14 @@ int main(int argc, char* argv[])
}
}

/* check that we got a valid progress value */
if (mfu_progress_timeout < 0) {
if (rank == 0) {
MFU_LOG(MFU_LOG_ERR, "Seconds in --progress must be non-negative: %d invalid", mfu_progress_timeout);
}
usage = 1;
}

/* paths to walk come after the options */
if (optind < argc) {
/* determine number of paths specified by user */
@@ -51,6 +51,7 @@ static void print_usage(void)
printf(" -b --batch-files <N> - batch files into groups of N during copy\n");
printf(" -c, --contents - read and compare file contents rather than compare size and mtime\n");
printf(" -D, --delete - delete extraneous files from target\n");
printf(" --progress <N> - print progress every N seconds\n");
printf(" -v, --verbose - verbose output\n");
printf(" -q, --quiet - quiet output\n");
printf(" -h, --help - print usage\n");
@@ -2250,6 +2251,7 @@ int main(int argc, char **argv)
{"delete", 0, 0, 'D'},
{"output", 1, 0, 'o'}, // undocumented
{"debug", 0, 0, 'd'}, // undocumented
{"progress", 1, 0, 'P'},
{"verbose", 0, 0, 'v'},
{"quiet", 0, 0, 'q'},
{"help", 0, 0, 'h'},
@@ -2297,6 +2299,9 @@ int main(int argc, char **argv)
case 'd':
options.debug++;
break;
case 'P':
mfu_progress_timeout = atoi(optarg);
break;
case 'v':
options.verbose++;
mfu_debug_level = MFU_LOG_VERBOSE;
@@ -2316,6 +2321,14 @@ int main(int argc, char **argv)
}
}

/* check that we got a valid progress value */
if (mfu_progress_timeout < 0) {
if (rank == 0) {
MFU_LOG(MFU_LOG_ERR, "Seconds in --progress must be non-negative: %d invalid", mfu_progress_timeout);
}
usage = 1;
}

/* Generate default output */
if (list_empty(&options.outputs)) {
/*

0 comments on commit ee5befc

Please sign in to comment.
You can’t perform that action at this time.