6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
9 * Revision 1.1 1987-08-22 17:03:18 wesommer
15 static char *rcsid_copy_backups_c = "$Header$";
19 #include <sys/types.h>
26 static struct update_desc info = {
27 42, /* last_time_tried */
30 "backup", /* service_name */
31 "ZEUS.MIT.EDU", /* host_name */
32 "/tmp/frobnicate", /* target_path */
39 extern char *error_message();
48 struct direct *pde, *sde;
50 whoami = rindex(argv[0], '/');
56 if (chdir ("/u3/sms_backup") < 0) {
57 perror("can't change to /u3/sms_backup");
63 perror("can't open sms_backup directory");
67 while ( (pde = readdir(pd)) != NULL ) {
68 char *dir_name = pde->d_name;
69 printf("Directory: %s\n", dir_name);
71 if (dir_name[0] == '.') continue; /* ignore hidden files */
73 if (chdir(dir_name) < 0) {
79 perror("Can't open .");
82 while ( (sde = readdir(sd)) != NULL ) {
83 if (sde->d_name[0] == '.') continue;
85 sprintf(buf, "/site/sms/sms_backup/%s/%s", dir_name, sde->d_name);
86 printf("Updating: %s\n", buf);
87 info.target_path = buf;
88 rc = sms_update_server(&info, sde->d_name);
89 if (rc) printf("return code: %s\n", error_message(rc));
103 * c-continued-statement-offset: 4
105 * c-argdecl-indent: 4