#include <sys/stat.h>
#include <sys/time.h>
-#undef NFS_DIR
-#define NFS_DIR "/u1/sms/dcm/nfs"
#define min(x,y) ((x) < (y) ? (x) : (y))
char *whoami = "nfs.gen";
char *malloc(), *strsave();
char *ingres_date_and_time(), *ingres_time(), *ingres_date();
+char nfs_dir[64];
main(argc, argv)
int argc;
IIseterr(ingerr);
initialize_sms_error_table();
+ sprintf(nfs_dir, "%s/nfs", DCM_DIR);
+
## ingres sms
## set lockmode session where level = table
}
if (argc == 2) {
- sprintf(cmd, "cd %s; cp /u1/sms/nfs/* .; tar cf %s .", NFS_DIR, argv[1]);
+ sprintf(cmd, "cd %s; cp %s/nfs/* .; tar cf %s .",
+ nfs_dir, SMS_DIR, argv[1]);
if (system(cmd))
exit(SMS_TAR_FAIL);
}
## char *listname, *lsname, lname[33], uname[9], *filetime;
## int uid, id, flag1, flag2, flag3, flag4;
- sprintf(file, "%s/list-", NFS_DIR);
+ sprintf(file, "%s/list-", nfs_dir);
if (stat(file, &sb) == 0) {
filetime = ingres_date_and_time(sb.st_mtime);
## retrieve (flag1 = int4(interval("min", tblstats.modtime - filetime)))
while (sq_get_data(lists, &listname)) {
if (strlen(listname) == 0)
continue;
- sprintf(file, "%s/list-%s", NFS_DIR, listname);
+ sprintf(file, "%s/list-%s", nfs_dir, listname);
fd = fopen(file, "w");
if (!fd) {
fprintf(stderr, "cannot open %s for output\n", file);
struct save_queue *sq;
fprintf(stderr, "Building the list of everybody\n");
- sprintf(buf, "%s/list-", NFS_DIR);
+ sprintf(buf, "%s/list-", nfs_dir);
fd = fopen(buf, "w");
if (!fd) {
fprintf(stderr, "cannot open %s for output\n", buf);
struct save_queue *sq;
/*
- sprintf(file, "%s/list-", NFS_DIR);
+ sprintf(file, "%s/list-", nfs_dir);
if (stat(file, &sb) == 0) {
filetime = ingres_date_and_time(sb.st_mtime);
# retrieve (flag1 = int4(interval("min", tblstats.modtime - filetime)))
## repeat retrieve (listname = trim(s.value3))
## where s.mach_id = m.mach_id and m.name = @machname
strtrim(machname);
- sprintf(f1, "%s/list-%s", NFS_DIR, listname);
- sprintf(f2, "%s/%s.cred", NFS_DIR, machname);
+ sprintf(f1, "%s/list-%s", nfs_dir, listname);
+ sprintf(f2, "%s/%s.cred", nfs_dir, machname);
unlink(f2); /* ignore errors on this unlink */
if (link(f1, f2)) {
fprintf(stderr, "Cannot link %s to %s\n", f1, f2);
## repeat retrieve (id = n.nfsphys_id) where n.mach_id = m.mach_id and
## m.#name = @machname and n.#device = @device
while (cp = index(device, '/')) *cp = '@';
- sprintf(file, "%s/%s.%s.quotas", NFS_DIR, machname, device);
+ sprintf(file, "%s/%s.%s.quotas", nfs_dir, machname, device);
fd = fopen(file, "w");
if (!fd) {
fprintf(stderr, "cannot open %s for output\n", file);
fprintf(stderr, "error closing %s", file);
exit(SMS_CCONFIG);
}
- sprintf(file, "%s/%s.%s.dirs", NFS_DIR, machname, device);
+ sprintf(file, "%s/%s.%s.dirs", nfs_dir, machname, device);
fd = fopen(file, "w");
if (!fd) {
fprintf(stderr, "cannot open %s for output\n", file);