Lines Matching defs:n
58 static void rotateto(struct fn *fnp, struct opts *opts, int n,
108 "Usage: logadm [options]\n"\
109 " (processes all entries in /etc/logadm.conf or conffile given by -f)\n"\
110 " or: logadm [options] logname...\n"\
111 " (processes the given lognames)\n"\
112 "\n"\
113 "General options:\n"\
114 " -e mailaddr mail errors to given address\n"\
115 " -F timestamps use timestamps instead of /var/logadm/timestamps\n"\
116 " -f conffile use conffile instead of /etc/logadm.conf\n"\
117 " -h display help\n"\
118 " -N not an error if log file nonexistent\n"\
119 " -n show actions, don't perform them\n"\
120 " -r remove logname entry from conffile\n"\
121 " -V ensure conffile entries exist, correct\n"\
122 " -v print info about actions happening\n"\
123 " -w entryname write entry to config file\n"\
124 "\n"\
125 "Options which control when a logfile is rotated:\n"\
126 "(default is: -s1b -p1w if no -s or -p)\n"\
127 " -p period only rotate if period passed since last rotate\n"\
128 " -P timestamp used to store rotation date in conffile\n"\
129 " -s size only rotate if given size or greater\n"\
130 "\n"
132 "Options which control how a logfile is rotated:\n"\
133 "(default is: -t '$file.$n', owner/group/mode taken from log file)\n"\
134 " -a cmd execute cmd after taking actions\n"\
135 " -b cmd execute cmd before taking actions\n"\
136 " -c copy & truncate logfile, don't rename\n"\
137 " -g group new empty log file group\n"\
138 " -l rotate log file with local time rather than UTC\n"\
139 " -m mode new empty log file mode\n"\
140 " -M cmd execute cmd to rotate the log file\n"\
141 " -o owner new empty log file owner\n"\
142 " -R cmd run cmd on file after rotate\n"\
143 " -t template template for naming old logs\n"\
144 " -z count gzip old logs except most recent count\n"\
145 "\n"\
146 "Options which control the expiration of old logfiles:\n"\
147 "(default is: -C10 if no -A, -C, or -S)\n"\
148 " -A age expire logs older than age\n"\
149 " -C count expire old logs until count remain\n"\
150 " -E cmd run cmd on file to expire\n"\
151 " -S size expire until space used is below size \n"\
152 " -T pattern pattern for finding old logs\n"
230 (void) fprintf(stderr, "\n");
312 (void) out("# loading %s\n", conffile);
321 "main: add/replace conffile entry: <%s>\n",
346 "main: run all entries in conffile\n");
357 "main: logname already done: <%s>\n",
389 err(EF_RAW, "Use \"logadm -h\" for help.\n");
437 "expired file <%s>\n", lhs);
460 (void) out("# processing logname: %s\n", logname);
464 (void) fprintf(stderr, "dologname: logname <%s>\n",
468 (void) fprintf(stderr, "\n");
476 "dologname: lookup conffile entry\n");
480 (void) out("\n");
490 "dologname: remove conffile entry\n");
511 "# using default rotate rules: -s1b -p1w\n");
519 (void) out("# using default expire rule: -C10\n");
526 (void) out("# using default template: $file.$n\n");
527 (void) opts_set(allopts, "t", "$file.$n");
533 (void) fprintf(stderr, "\n");
544 (void) fprintf(stderr, "dologname: logfiles from cfopts:\n");
549 (void) fprintf(stderr, " <%s>\n", buf);
587 (void) fprintf(stderr, "rotatelog: fname <%s>\n", fname);
595 (void) fprintf(stderr, "rotatelog keywords:\n");
687 (void) fprintf(stderr, "rotatelog: conditions met\n");
770 (void) out("# recording rotation date %s for %s\n",
779 rotateto(struct fn *fnp, struct opts *opts, int n, struct fn *recentlog,
791 hasn = kw_expand(template, newfile, n, isgz);
798 (void) fprintf(stderr, "rotateto: %s -> %s (%d)\n",
799 buf1, buf2, n);
803 rotateto(newfile, opts, n + 1, recentlog, isgz);
812 rotateto(gzfnp, opts, n + 1, recentlog, B_TRUE);
817 if (n == 0 && opts_count(opts, "b")) {
833 if (n == 0 && opts_count(opts, "c") != NULL) {
835 } else if (n == 0 && opts_count(opts, "M")) {
851 if (n == 0)
868 (void) fprintf(stderr, "expirefiles: fname <%s>\n", fname);
876 (void) fprintf(stderr, "expirefiles keywords:\n");
900 (void) fprintf(stderr, "expirefiles: pattern <%s>\n",
907 (void) fprintf(stderr, " <%s>\n", buf);
915 (void) fprintf(stderr, "expirefiles: needexpire %d\n",
965 "will compress %s count %d\n",
999 /* execute a command, producing -n and -v output as necessary */
1024 (void) out("\n");
1027 if (opts_count(opts, "n"))
1028 return; /* -n means don't really do it */
1115 " (-c flag):\n");
1116 (void) out("# copy %s to %s\n", file, file_copy);
1117 (void) out("# truncate %s\n", file);
1120 if (opts_count(opts, "n"))
1121 return; /* -n means don't really do it */