Print this page
13066 Want crontab -u
Change-ID: I3dc2251dbbcc721aeff25a9dde21a24271c927bc


  26 .\"
  27 .\" The contents of this file are subject to the terms of the
  28 .\" Common Development and Distribution License (the "License").
  29 .\" You may not use this file except in compliance with the License.
  30 .\"
  31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Copyright 1989 AT&T
  44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
  45 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
  46 .\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  47 .\"
  48 .TH CRONTAB 1 "Oct 22, 2019"
  49 .SH NAME
  50 crontab \- user crontab file
  51 .SH SYNOPSIS
  52 .nf
  53 \fB/usr/bin/crontab\fR [\fIfilename\fR]
  54 .fi
  55 
  56 .LP
  57 .nf
  58 \fB/usr/bin/crontab\fR \fB-e\fR [\fIusername\fR]
  59 .fi
  60 
  61 .LP
  62 .nf
  63 \fB/usr/bin/crontab\fR \fB-l\fR [\fIusername\fR]
  64 .fi
  65 
  66 .LP
  67 .nf
  68 \fB/usr/bin/crontab\fR \fB-r\fR [\fIusername\fR]
  69 .fi
  70 
  71 .LP
  72 .nf
  73 \fB/usr/xpg4/bin/crontab\fR [\fIfilename\fR]
  74 .fi
  75 
  76 .LP
  77 .nf
  78 \fB/usr/xpg4/bin/crontab\fR \fB-e\fR [\fIusername\fR]
  79 .fi
  80 
  81 .LP
  82 .nf
  83 \fB/usr/xpg4/bin/crontab\fR \fB-l\fR [\fIusername\fR]
  84 .fi
  85 
  86 .LP
  87 .nf
  88 \fB/usr/xpg4/bin/crontab\fR \fB-r\fR [\fIusername\fR]
  89 .fi
  90 
  91 .LP
  92 .nf
  93 \fB/usr/xpg6/bin/crontab\fR [\fIfilename\fR]
  94 .fi
  95 
  96 .LP
  97 .nf
  98 \fB/usr/xpg6/bin/crontab\fR \fB-e\fR [\fIusername\fR]
  99 .fi
 100 
 101 .LP
 102 .nf
 103 \fB/usr/xpg6/bin/crontab\fR \fB-l\fR [\fIusername\fR]
 104 .fi
 105 
 106 .LP
 107 .nf
 108 \fB/usr/xpg6/bin/crontab\fR \fB-r\fR [\fIusername\fR]
 109 .fi
 110 
 111 .SH DESCRIPTION
 112 The \fBcrontab\fR utility manages a user's access with \fBcron\fR (see
 113 \fBcron\fR(1M)) by copying, creating, listing, and removing \fBcrontab\fR
 114 files. If invoked without options, \fBcrontab\fR copies the specified file, or
 115 the standard input if no file is specified, into a directory that holds all
 116 users' crontabs.
 117 .sp
 118 .LP
 119 If \fBcrontab\fR is invoked with \fIfilename\fR, this overwrites an existing
 120 \fBcrontab\fR entry for the user that invokes it.

 121 .SS "\fBcrontab\fR Access Control"
 122 Users: Access to \fBcrontab\fR is allowed:
 123 .RS +4
 124 .TP
 125 .ie t \(bu
 126 .el o
 127 if the user's name appears in \fB/etc/cron.d/cron.allow\fR.
 128 .RE
 129 .RS +4
 130 .TP
 131 .ie t \(bu
 132 .el o
 133 if \fB/etc/cron.d/cron.allow\fR does not exist and the user's name is not in
 134 \fB/etc/cron.d/cron.deny\fR.
 135 .RE
 136 .sp
 137 .LP
 138 Users: Access to \fBcrontab\fR is denied:
 139 .RS +4
 140 .TP


 255 \&...which will take precedence for all the remaining entries in the
 256 \fBcrontab\fR or until there is another \fBHOME\fR or \fBSHELL\fR entry. It is
 257 invoked with an \fBarg0\fR of the basename of the $SHELL that is currently in
 258 effect. A user who wants to have his \fB\&.profile\fR or equivalent file
 259 executed must  explicitly do so in the \fBcrontab\fR file. \fBcron\fR supplies
 260 a default environment for every shell, defining HOME, LOGNAME, SHELL, TZ, and
 261 PATH. The default PATH for user \fBcron\fR jobs is \fB/usr/bin\fR; while root
 262 \fBcron\fR jobs default to \fB/usr/sbin:/usr/bin\fR. The default PATH can be
 263 set in \fB/etc/default/cron\fR (see \fBcron\fR(1M)). The TZ, HOME, and SHELL
 264 environment variables are set to match those that are in effect in the
 265 \fBcrontab\fR file at the time.
 266 .sp
 267 .LP
 268 If you do not redirect the standard output and standard error of your commands,
 269 any generated output or errors are mailed to you.
 270 .SS "\fBcrontab\fR Environment Variables"
 271 The following variables are supported:
 272 .sp
 273 .ne 2
 274 .na
 275 \fB\fBHOME\fR\fR
 276 .ad
 277 .sp .6
 278 .RS 4n
 279 Allows the user to choose and alternative directory for cron to change
 280 directory to prior to running the command. For example:
 281 .sp
 282 .in +2
 283 .nf
 284 HOME=/var/tmp
 285 .fi
 286 .in -2
 287 .sp
 288 
 289 .RE
 290 
 291 .sp
 292 .ne 2
 293 .na
 294 \fB\fBSHELL\fR\fR
 295 .ad
 296 .sp .6
 297 .RS 4n
 298 The name of the shell to use to run subsequent commands. For example:
 299 .sp
 300 .in +2
 301 .nf
 302 SHELL=/usr/bin/ksh
 303 .fi
 304 .in -2
 305 .sp
 306 
 307 .RE
 308 
 309 .sp
 310 .ne 2
 311 .na
 312 \fB\fBTZ\fR\fR
 313 .ad
 314 .sp .6
 315 .RS 4n
 316 Allows the user to choose the timezone in which the \fBcron\fR entries are run.
 317 This effects both the environment of the command that is run and the timing of
 318 the entry. For example, to have your entries run using the timezone for
 319 Iceland, use:
 320 .sp
 321 .in +2
 322 .nf
 323 TZ=Iceland
 324 .fi
 325 .in -2
 326 .sp
 327 
 328 .RE
 329 
 330 .sp
 331 .LP
 332 Each of these variables affects all of the lines that follow it in the


 335 single \fBcrontab\fR file.
 336 .sp
 337 .LP
 338 The lines that are not setting these environment variables are  the same as
 339 crontab entries that conform to the UNIX standard and are described elsewhere
 340 in this man page.
 341 .SS "Setting \fBcron\fR Jobs Across Timezones"
 342 The default timezone of the \fBcron\fR daemon sets the system-wide timezone for
 343 \fBcron\fR entries. This, in turn, is by set by default system-wide using
 344 \fB/etc/default/init\fR.
 345 .sp
 346 .LP
 347 If some form of \fBdaylight savings\fR or \fBsummer/winter time\fR is in
 348 effect, then jobs scheduled during the switchover period could be executed
 349 once, twice, or not at all.
 350 .SH OPTIONS
 351 The following options are supported:
 352 .sp
 353 .ne 2
 354 .na
 355 \fB\fB-e\fR\fR
 356 .ad
 357 .RS 6n
 358 Edits a copy of the current user's \fBcrontab\fR file, or creates an empty file
 359 to edit if \fBcrontab\fR does not exist. When editing is complete, the file is
 360 installed as the user's \fBcrontab\fR file.
 361 .sp
 362 The environment variable \fBEDITOR\fR determines which editor is invoked with
 363 the \fB-e\fR option. All \fBcrontab\fR jobs should be submitted using
 364 \fBcrontab\fR. Do not add jobs by just editing the \fBcrontab\fR file, because
 365 \fBcron\fR is not aware of changes made this way.
 366 .sp
 367 If all lines in the \fBcrontab\fR file are deleted, the old \fBcrontab\fR file
 368 is restored. The correct way to delete all lines is to remove the \fBcrontab\fR
 369 file using the \fB-r\fR option.
 370 .sp
 371 If \fIusername\fR is specified, the specified user's \fBcrontab\fR file is
 372 edited, rather than the current user's \fBcrontab\fR file. This can only be
 373 done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
 374 .RE
 375 
 376 .sp
 377 .ne 2
 378 .na
 379 \fB\fB-l\fR\fR
 380 .ad
 381 .RS 6n
 382 Lists the \fBcrontab\fR file for the invoking user. Only root or a user with
 383 the \fBsolaris.jobs.admin\fR authorization can specify a username following the
 384 \fB-l\fR option to list the \fBcrontab\fR file of the specified user.
 385 .RE
 386 
 387 .sp
 388 .ne 2
 389 .na
 390 \fB\fB-r\fR\fR
 391 .ad
 392 .RS 6n
 393 Removes a user's \fBcrontab\fR from the \fBcrontab\fR directory. Only root or a
 394 user with the \fBsolaris.jobs.admin\fR authorization can specify a username
 395 following the \fB-r\fR option to remove the \fBcrontab\fR file of the specified
 396 user.
 397 .RE
 398 












 399 .SH EXAMPLES
 400 \fBExample 1 \fRCleaning up Core Files
 401 .sp
 402 .LP
 403 This example cleans up \fBcore\fR files every weekday morning at 3:15 am:
 404 
 405 .sp
 406 .in +2
 407 .nf
 408 \fB15 3 * * 1-5 find $HOME\fR \fB-name\fR\fBcore 2>/dev/null | xargs rm\fR \fB-f\fR
 409 .fi
 410 .in -2
 411 .sp
 412 
 413 .LP
 414 \fBExample 2 \fRMailing a Birthday Greeting
 415 .sp
 416 .LP
 417 This example mails a birthday greeting:
 418 


 503 SHELL=/bin/csh
 504 .fi
 505 .in -2
 506 .sp
 507 
 508 .sp
 509 .LP
 510 The preceding entries allow two jobs to run. The first one would run at
 511 midnight in the GMT timezone and the second would run at midnight in the PST
 512 timezone. Both would be run in the directory \fB/local/home/user\fR using the
 513 Korn shell. The file concludes with \fBTZ\fR, \fBHOME\fR, and \fBSHELL\fR
 514 entries that return those variable to their default values.
 515 
 516 .SH ENVIRONMENT VARIABLES
 517 See \fBenviron\fR(5) for descriptions of the following environment variables
 518 that affect the execution of \fBcrontab\fR: \fBLANG\fR, \fBLC_ALL\fR,
 519 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 520 .SS "\fB/usr/bin/crontab\fR"
 521 .ne 2
 522 .na
 523 \fB\fBEDITOR\fR\fR
 524 .ad
 525 .RS 10n
 526 Determine the editor to be invoked when the \fB-e\fR option is specified. This
 527 is overridden by the \fBVISUAL\fR environmental variable. The default editor is
 528 \fBvi\fR(1).
 529 .RE
 530 
 531 .sp
 532 .ne 2
 533 .na
 534 \fB\fBPATH\fR\fR
 535 .ad
 536 .RS 10n
 537 The \fBPATH\fR in \fBcrontab\fR's environment specifies the search path used to
 538 find the editor.
 539 .RE
 540 
 541 .sp
 542 .ne 2
 543 .na
 544 \fB\fBVISUAL\fR\fR
 545 .ad
 546 .RS 10n
 547 Determine the visual editor to be invoked when the \fB-e\fR option is
 548 specified. If \fBVISUAL\fR is not specified, then the environment variable
 549 \fBEDITOR\fR is used. If that is not set, the default is \fBvi\fR(1).
 550 .RE
 551 
 552 .SS "\fB/usr/xpg4/bin/crontab\fR"
 553 .ne 2
 554 .na
 555 \fB\fBEDITOR\fR\fR
 556 .ad
 557 .RS 10n
 558 Determine the editor to be invoked when the \fB-e\fR option is specified. The
 559 default editor is \fB/usr/xpg4/bin/vi\fR.
 560 .RE
 561 
 562 .SS "\fB/usr/xpg6/bin/crontab\fR"
 563 .ne 2
 564 .na
 565 \fB\fBEDITOR\fR\fR
 566 .ad
 567 .RS 10n
 568 Determine the editor to be invoked when the \fB-e\fR option is specified. The
 569 default editor is \fB/usr/xpg6/bin/vi\fR.
 570 .RE
 571 
 572 .SH EXIT STATUS
 573 The following exit values are returned:
 574 .sp
 575 .ne 2
 576 .na
 577 \fB\fB0\fR\fR
 578 .ad
 579 .RS 6n
 580 Successful completion.
 581 .RE
 582 
 583 .sp
 584 .ne 2
 585 .na
 586 \fB\fB>0\fR\fR
 587 .ad
 588 .RS 6n
 589 An error occurred.
 590 .RE
 591 
 592 .SH FILES
 593 .ne 2
 594 .na
 595 \fB\fB/etc/cron.d\fR\fR
 596 .ad
 597 .RS 28n
 598 main cron directory
 599 .RE
 600 
 601 .sp
 602 .ne 2
 603 .na
 604 \fB\fB/etc/cron.d/cron.allow\fR\fR
 605 .ad
 606 .RS 28n
 607 list of allowed users
 608 .RE
 609 
 610 .sp
 611 .ne 2
 612 .na
 613 \fB\fB/etc/default/cron\fR\fR
 614 .ad
 615 .RS 28n
 616 contains cron default settings
 617 .RE
 618 
 619 .sp
 620 .ne 2
 621 .na
 622 \fB\fB/etc/cron.d/cron.deny\fR\fR
 623 .ad
 624 .RS 28n
 625 list of denied users
 626 .RE
 627 
 628 .sp
 629 .ne 2
 630 .na
 631 \fB\fB/var/cron/log\fR\fR
 632 .ad
 633 .RS 28n
 634 accounting information
 635 .RE
 636 
 637 .sp
 638 .ne 2
 639 .na
 640 \fB\fB/var/spool/cron/crontabs\fR\fR
 641 .ad
 642 .RS 28n
 643 spool area for \fBcrontab\fR
 644 .RE
 645 
 646 .SH ATTRIBUTES
 647 See \fBattributes\fR(5) for descriptions of the following attributes:
 648 .SS "\fB/usr/bin/crontab\fR"
 649 
 650 .TS
 651 box;
 652 c | c
 653 l | l .
 654 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 655 _
 656 Interface Stability     Standard
 657 .TE
 658 
 659 .SS "\fB/usr/xpg4/bin/crontab\fR"
 660 




  26 .\"
  27 .\" The contents of this file are subject to the terms of the
  28 .\" Common Development and Distribution License (the "License").
  29 .\" You may not use this file except in compliance with the License.
  30 .\"
  31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Copyright 1989 AT&T
  44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
  45 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
  46 .\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  47 .\"
  48 .TH CRONTAB 1 "Aug 20, 2020"
  49 .SH NAME
  50 crontab \- user crontab file
  51 .SH SYNOPSIS
  52 .nf
  53 \fB/usr/bin/crontab\fR [\fB-u\fR \fIusername\fR] [\fIfilename\fR]
  54 .fi
  55 
  56 .LP
  57 .nf
  58 \fB/usr/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR]
  59 .fi
  60 
  61 .LP
  62 .nf
  63 \fB/usr/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR
  64 .fi
  65 
  66 .LP
  67 .nf





  68 \fB/usr/xpg4/bin/crontab\fR [\fIfilename\fR]
  69 .fi
  70 
  71 .LP
  72 .nf
  73 \fB/usr/xpg4/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR]
  74 .fi
  75 
  76 .LP
  77 .nf
  78 \fB/usr/xpg4/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR
  79 .fi
  80 
  81 .LP
  82 .nf





  83 \fB/usr/xpg6/bin/crontab\fR [\fIfilename\fR]
  84 .fi
  85 
  86 .LP
  87 .nf
  88 \fB/usr/xpg6/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR]
  89 .fi
  90 
  91 .LP
  92 .nf
  93 \fB/usr/xpg6/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR
  94 .fi
  95 





  96 .SH DESCRIPTION
  97 The \fBcrontab\fR utility manages a user's access with \fBcron\fR (see
  98 \fBcron\fR(1M)) by copying, creating, listing, and removing \fBcrontab\fR
  99 files. If invoked without options, \fBcrontab\fR copies the specified file, or
 100 the standard input if no file is specified, into a directory that holds all
 101 users' crontabs.
 102 .sp
 103 .LP
 104 If \fBcrontab\fR is invoked with \fIfilename\fR, this overwrites an existing
 105 \fBcrontab\fR entry for the user that invokes it, or for the user specified
 106 with the \fB-u\fR option.
 107 .SS "\fBcrontab\fR Access Control"
 108 Users: Access to \fBcrontab\fR is allowed:
 109 .RS +4
 110 .TP
 111 .ie t \(bu
 112 .el o
 113 if the user's name appears in \fB/etc/cron.d/cron.allow\fR.
 114 .RE
 115 .RS +4
 116 .TP
 117 .ie t \(bu
 118 .el o
 119 if \fB/etc/cron.d/cron.allow\fR does not exist and the user's name is not in
 120 \fB/etc/cron.d/cron.deny\fR.
 121 .RE
 122 .sp
 123 .LP
 124 Users: Access to \fBcrontab\fR is denied:
 125 .RS +4
 126 .TP


 241 \&...which will take precedence for all the remaining entries in the
 242 \fBcrontab\fR or until there is another \fBHOME\fR or \fBSHELL\fR entry. It is
 243 invoked with an \fBarg0\fR of the basename of the $SHELL that is currently in
 244 effect. A user who wants to have his \fB\&.profile\fR or equivalent file
 245 executed must  explicitly do so in the \fBcrontab\fR file. \fBcron\fR supplies
 246 a default environment for every shell, defining HOME, LOGNAME, SHELL, TZ, and
 247 PATH. The default PATH for user \fBcron\fR jobs is \fB/usr/bin\fR; while root
 248 \fBcron\fR jobs default to \fB/usr/sbin:/usr/bin\fR. The default PATH can be
 249 set in \fB/etc/default/cron\fR (see \fBcron\fR(1M)). The TZ, HOME, and SHELL
 250 environment variables are set to match those that are in effect in the
 251 \fBcrontab\fR file at the time.
 252 .sp
 253 .LP
 254 If you do not redirect the standard output and standard error of your commands,
 255 any generated output or errors are mailed to you.
 256 .SS "\fBcrontab\fR Environment Variables"
 257 The following variables are supported:
 258 .sp
 259 .ne 2
 260 .na
 261 \fBHOME\fR
 262 .ad
 263 .sp .6
 264 .RS 4n
 265 Allows the user to choose and alternative directory for cron to change
 266 directory to prior to running the command. For example:
 267 .sp
 268 .in +2
 269 .nf
 270 HOME=/var/tmp
 271 .fi
 272 .in -2
 273 .sp
 274 
 275 .RE
 276 
 277 .sp
 278 .ne 2
 279 .na
 280 \fBSHELL\fR
 281 .ad
 282 .sp .6
 283 .RS 4n
 284 The name of the shell to use to run subsequent commands. For example:
 285 .sp
 286 .in +2
 287 .nf
 288 SHELL=/usr/bin/ksh
 289 .fi
 290 .in -2
 291 .sp
 292 
 293 .RE
 294 
 295 .sp
 296 .ne 2
 297 .na
 298 \fBTZ\fR
 299 .ad
 300 .sp .6
 301 .RS 4n
 302 Allows the user to choose the timezone in which the \fBcron\fR entries are run.
 303 This effects both the environment of the command that is run and the timing of
 304 the entry. For example, to have your entries run using the timezone for
 305 Iceland, use:
 306 .sp
 307 .in +2
 308 .nf
 309 TZ=Iceland
 310 .fi
 311 .in -2
 312 .sp
 313 
 314 .RE
 315 
 316 .sp
 317 .LP
 318 Each of these variables affects all of the lines that follow it in the


 321 single \fBcrontab\fR file.
 322 .sp
 323 .LP
 324 The lines that are not setting these environment variables are  the same as
 325 crontab entries that conform to the UNIX standard and are described elsewhere
 326 in this man page.
 327 .SS "Setting \fBcron\fR Jobs Across Timezones"
 328 The default timezone of the \fBcron\fR daemon sets the system-wide timezone for
 329 \fBcron\fR entries. This, in turn, is by set by default system-wide using
 330 \fB/etc/default/init\fR.
 331 .sp
 332 .LP
 333 If some form of \fBdaylight savings\fR or \fBsummer/winter time\fR is in
 334 effect, then jobs scheduled during the switchover period could be executed
 335 once, twice, or not at all.
 336 .SH OPTIONS
 337 The following options are supported:
 338 .sp
 339 .ne 2
 340 .na
 341 \fB-e\fR
 342 .ad
 343 .RS 6n
 344 Edits a copy of the current user's \fBcrontab\fR file, or creates an empty file
 345 to edit if \fBcrontab\fR does not exist. When editing is complete, the file is
 346 installed as the user's \fBcrontab\fR file.
 347 .sp
 348 The environment variable \fBEDITOR\fR determines which editor is invoked with
 349 the \fB-e\fR option. All \fBcrontab\fR jobs should be submitted using
 350 \fBcrontab\fR. Do not add jobs by just editing the \fBcrontab\fR file, because
 351 \fBcron\fR is not aware of changes made this way.
 352 .sp
 353 If all lines in the \fBcrontab\fR file are deleted, the old \fBcrontab\fR file
 354 is restored. The correct way to delete all lines is to remove the \fBcrontab\fR
 355 file using the \fB-r\fR option.
 356 .sp
 357 If \fIusername\fR is specified, the specified user's \fBcrontab\fR file is
 358 edited, rather than the current user's \fBcrontab\fR file. This can only be
 359 done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
 360 .RE
 361 
 362 .sp
 363 .ne 2
 364 .na
 365 \fB-l\fR
 366 .ad
 367 .RS 6n
 368 Lists the \fBcrontab\fR file for the invoking user. Only root or a user with
 369 the \fBsolaris.jobs.admin\fR authorization can specify a username following the
 370 \fB-l\fR option to list the \fBcrontab\fR file of the specified user.
 371 .RE
 372 
 373 .sp
 374 .ne 2
 375 .na
 376 \fB-r\fR
 377 .ad
 378 .RS 6n
 379 Removes a user's \fBcrontab\fR from the \fBcrontab\fR directory. Only root or a
 380 user with the \fBsolaris.jobs.admin\fR authorization can specify a username
 381 following the \fB-r\fR option to remove the \fBcrontab\fR file of the specified
 382 user.
 383 .RE
 384 
 385 .sp
 386 .ne 2
 387 .na
 388 \fB-u\fR \fIusername\fR
 389 .ad
 390 .RS 6n
 391 Specifies the name of the user whose \fBcrontab\fR is to be replaced, viewed or
 392 modified. This can only be done by root or by a user with the
 393 \fBsolaris.jobs.admin\fR authorization.
 394 
 395 .RE
 396 
 397 .SH EXAMPLES
 398 \fBExample 1 \fRCleaning up Core Files
 399 .sp
 400 .LP
 401 This example cleans up \fBcore\fR files every weekday morning at 3:15 am:
 402 
 403 .sp
 404 .in +2
 405 .nf
 406 \fB15 3 * * 1-5 find $HOME\fR \fB-name\fR\fBcore 2>/dev/null | xargs rm\fR \fB-f\fR
 407 .fi
 408 .in -2
 409 .sp
 410 
 411 .LP
 412 \fBExample 2 \fRMailing a Birthday Greeting
 413 .sp
 414 .LP
 415 This example mails a birthday greeting:
 416 


 501 SHELL=/bin/csh
 502 .fi
 503 .in -2
 504 .sp
 505 
 506 .sp
 507 .LP
 508 The preceding entries allow two jobs to run. The first one would run at
 509 midnight in the GMT timezone and the second would run at midnight in the PST
 510 timezone. Both would be run in the directory \fB/local/home/user\fR using the
 511 Korn shell. The file concludes with \fBTZ\fR, \fBHOME\fR, and \fBSHELL\fR
 512 entries that return those variable to their default values.
 513 
 514 .SH ENVIRONMENT VARIABLES
 515 See \fBenviron\fR(5) for descriptions of the following environment variables
 516 that affect the execution of \fBcrontab\fR: \fBLANG\fR, \fBLC_ALL\fR,
 517 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 518 .SS "\fB/usr/bin/crontab\fR"
 519 .ne 2
 520 .na
 521 \fBEDITOR\fR
 522 .ad
 523 .RS 10n
 524 Determine the editor to be invoked when the \fB-e\fR option is specified. This
 525 is overridden by the \fBVISUAL\fR environmental variable. The default editor is
 526 \fBvi\fR(1).
 527 .RE
 528 
 529 .sp
 530 .ne 2
 531 .na
 532 \fBPATH\fR
 533 .ad
 534 .RS 10n
 535 The \fBPATH\fR in \fBcrontab\fR's environment specifies the search path used to
 536 find the editor.
 537 .RE
 538 
 539 .sp
 540 .ne 2
 541 .na
 542 \fBVISUAL\fR
 543 .ad
 544 .RS 10n
 545 Determine the visual editor to be invoked when the \fB-e\fR option is
 546 specified. If \fBVISUAL\fR is not specified, then the environment variable
 547 \fBEDITOR\fR is used. If that is not set, the default is \fBvi\fR(1).
 548 .RE
 549 
 550 .SS "\fB/usr/xpg4/bin/crontab\fR"
 551 .ne 2
 552 .na
 553 \fBEDITOR\fR
 554 .ad
 555 .RS 10n
 556 Determine the editor to be invoked when the \fB-e\fR option is specified. The
 557 default editor is \fB/usr/xpg4/bin/vi\fR.
 558 .RE
 559 
 560 .SS "\fB/usr/xpg6/bin/crontab\fR"
 561 .ne 2
 562 .na
 563 \fBEDITOR\fR
 564 .ad
 565 .RS 10n
 566 Determine the editor to be invoked when the \fB-e\fR option is specified. The
 567 default editor is \fB/usr/xpg6/bin/vi\fR.
 568 .RE
 569 
 570 .SH EXIT STATUS
 571 The following exit values are returned:
 572 .sp
 573 .ne 2
 574 .na
 575 \fB0\fR
 576 .ad
 577 .RS 6n
 578 Successful completion.
 579 .RE
 580 
 581 .sp
 582 .ne 2
 583 .na
 584 \fB>0\fR
 585 .ad
 586 .RS 6n
 587 An error occurred.
 588 .RE
 589 
 590 .SH FILES
 591 .ne 2
 592 .na
 593 \fB/etc/cron.d\fR
 594 .ad
 595 .RS 28n
 596 main cron directory
 597 .RE
 598 
 599 .sp
 600 .ne 2
 601 .na
 602 \fB/etc/cron.d/cron.allow\fR
 603 .ad
 604 .RS 28n
 605 list of allowed users
 606 .RE
 607 
 608 .sp
 609 .ne 2
 610 .na
 611 \fB/etc/default/cron\fR
 612 .ad
 613 .RS 28n
 614 contains cron default settings
 615 .RE
 616 
 617 .sp
 618 .ne 2
 619 .na
 620 \fB/etc/cron.d/cron.deny\fR
 621 .ad
 622 .RS 28n
 623 list of denied users
 624 .RE
 625 
 626 .sp
 627 .ne 2
 628 .na
 629 \fB/var/cron/log\fR
 630 .ad
 631 .RS 28n
 632 accounting information
 633 .RE
 634 
 635 .sp
 636 .ne 2
 637 .na
 638 \fB/var/spool/cron/crontabs\fR
 639 .ad
 640 .RS 28n
 641 spool area for \fBcrontab\fR
 642 .RE
 643 
 644 .SH ATTRIBUTES
 645 See \fBattributes\fR(5) for descriptions of the following attributes:
 646 .SS "\fB/usr/bin/crontab\fR"
 647 
 648 .TS
 649 box;
 650 c | c
 651 l | l .
 652 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 653 _
 654 Interface Stability     Standard
 655 .TE
 656 
 657 .SS "\fB/usr/xpg4/bin/crontab\fR"
 658