2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3
Copyright (C) 2005- The University of Notre Dame
4
This software is distributed under the GNU General Public License.
5
See the file COPYING for details.
15
#include "chirp_reli.h"
16
#include "chirp_recursive.h"
20
#include "stringtools.h"
24
static int timeout=3600;
26
static void show_version( const char *cmd )
28
printf("%s version %d.%d.%d built by %s@%s on %s at %s\n",cmd,CCTOOLS_VERSION_MAJOR,CCTOOLS_VERSION_MINOR,CCTOOLS_VERSION_MICRO,BUILD_USER,BUILD_HOST,__DATE__,__TIME__);
31
static void show_help( const char *cmd )
33
printf("use: %s [options] <hostname[:port]> <remote-file> <local-file>\n",cmd);
34
printf("where options are:\n");
35
printf(" -a <flag> Require this authentication mode.\n");
36
printf(" -d <flag> Enable debugging for this subsystem.\n");
37
printf(" -t <time> Timeout for failure. (default is %ds)\n",timeout);
38
printf(" -v Show program version.\n");
39
printf(" -h This message.\n");
42
int main( int argc, char *argv[] )
44
int did_explicit_auth = 0;
46
const char *hostname, *source_file, *target_file;
52
debug_config(argv[0]);
54
while((c=getopt(argc,argv,"a:d:t:vh"))!=(char)-1) {
57
auth_register_byname(optarg);
58
did_explicit_auth = 1;
61
debug_flags_set(optarg);
64
timeout = string_time_parse(optarg);
67
show_version(argv[0]);
78
if(!did_explicit_auth) auth_register_all();
80
if( (argc-optind)<3 ) {
85
hostname = argv[optind];
86
source_file = argv[optind+1];
87
target_file = argv[optind+2];
88
stoptime = time(0) + timeout;
90
if(!strcmp(target_file,"-")) {
96
result = chirp_reli_getfile(hostname,source_file,file,stoptime);
98
result = chirp_recursive_get(hostname,source_file,target_file,stoptime);
102
fprintf(stderr,"couldn't get %s:%s: %s\n",hostname,source_file,strerror(errno));