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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/crontab.1
          +++ new/usr/src/man/man1/crontab.1
↓ open down ↓ 35 lines elided ↑ open up ↑
  36   36  .\" When distributing Covered Code, include this CDDL HEADER in each
  37   37  .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38   38  .\" If applicable, add the following below this CDDL HEADER, with the
  39   39  .\" fields enclosed by brackets "[]" replaced with your own identifying
  40   40  .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41   41  .\"
  42   42  .\"
  43   43  .\" Copyright 1989 AT&T
  44   44  .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
  45   45  .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
  46      -.\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
       46 +.\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  47   47  .\"
  48      -.TH CRONTAB 1 "Oct 22, 2019"
       48 +.TH CRONTAB 1 "Aug 20, 2020"
  49   49  .SH NAME
  50   50  crontab \- user crontab file
  51   51  .SH SYNOPSIS
  52   52  .nf
  53      -\fB/usr/bin/crontab\fR [\fIfilename\fR]
       53 +\fB/usr/bin/crontab\fR [\fB-u\fR \fIusername\fR] [\fIfilename\fR]
  54   54  .fi
  55   55  
  56   56  .LP
  57   57  .nf
  58      -\fB/usr/bin/crontab\fR \fB-e\fR [\fIusername\fR]
       58 +\fB/usr/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR]
  59   59  .fi
  60   60  
  61   61  .LP
  62   62  .nf
  63      -\fB/usr/bin/crontab\fR \fB-l\fR [\fIusername\fR]
       63 +\fB/usr/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR
  64   64  .fi
  65   65  
  66   66  .LP
  67   67  .nf
  68      -\fB/usr/bin/crontab\fR \fB-r\fR [\fIusername\fR]
  69      -.fi
  70      -
  71      -.LP
  72      -.nf
  73   68  \fB/usr/xpg4/bin/crontab\fR [\fIfilename\fR]
  74   69  .fi
  75   70  
  76   71  .LP
  77   72  .nf
  78      -\fB/usr/xpg4/bin/crontab\fR \fB-e\fR [\fIusername\fR]
       73 +\fB/usr/xpg4/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR]
  79   74  .fi
  80   75  
  81   76  .LP
  82   77  .nf
  83      -\fB/usr/xpg4/bin/crontab\fR \fB-l\fR [\fIusername\fR]
       78 +\fB/usr/xpg4/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR
  84   79  .fi
  85   80  
  86   81  .LP
  87   82  .nf
  88      -\fB/usr/xpg4/bin/crontab\fR \fB-r\fR [\fIusername\fR]
  89      -.fi
  90      -
  91      -.LP
  92      -.nf
  93   83  \fB/usr/xpg6/bin/crontab\fR [\fIfilename\fR]
  94   84  .fi
  95   85  
  96   86  .LP
  97   87  .nf
  98      -\fB/usr/xpg6/bin/crontab\fR \fB-e\fR [\fIusername\fR]
       88 +\fB/usr/xpg6/bin/crontab\fR \fB{ -e | -l | -r }\fR [\fIusername\fR]
  99   89  .fi
 100   90  
 101   91  .LP
 102   92  .nf
 103      -\fB/usr/xpg6/bin/crontab\fR \fB-l\fR [\fIusername\fR]
       93 +\fB/usr/xpg6/bin/crontab\fR \fB-u\fR \fIusername\fR \fB{ -e | -l | -r }\fR
 104   94  .fi
 105   95  
 106      -.LP
 107      -.nf
 108      -\fB/usr/xpg6/bin/crontab\fR \fB-r\fR [\fIusername\fR]
 109      -.fi
 110      -
 111   96  .SH DESCRIPTION
 112   97  The \fBcrontab\fR utility manages a user's access with \fBcron\fR (see
 113   98  \fBcron\fR(1M)) by copying, creating, listing, and removing \fBcrontab\fR
 114   99  files. If invoked without options, \fBcrontab\fR copies the specified file, or
 115  100  the standard input if no file is specified, into a directory that holds all
 116  101  users' crontabs.
 117  102  .sp
 118  103  .LP
 119  104  If \fBcrontab\fR is invoked with \fIfilename\fR, this overwrites an existing
 120      -\fBcrontab\fR entry for the user that invokes it.
      105 +\fBcrontab\fR entry for the user that invokes it, or for the user specified
      106 +with the \fB-u\fR option.
 121  107  .SS "\fBcrontab\fR Access Control"
 122  108  Users: Access to \fBcrontab\fR is allowed:
 123  109  .RS +4
 124  110  .TP
 125  111  .ie t \(bu
 126  112  .el o
 127  113  if the user's name appears in \fB/etc/cron.d/cron.allow\fR.
 128  114  .RE
 129  115  .RS +4
 130  116  .TP
↓ open down ↓ 134 lines elided ↑ open up ↑
 265  251  \fBcrontab\fR file at the time.
 266  252  .sp
 267  253  .LP
 268  254  If you do not redirect the standard output and standard error of your commands,
 269  255  any generated output or errors are mailed to you.
 270  256  .SS "\fBcrontab\fR Environment Variables"
 271  257  The following variables are supported:
 272  258  .sp
 273  259  .ne 2
 274  260  .na
 275      -\fB\fBHOME\fR\fR
      261 +\fBHOME\fR
 276  262  .ad
 277  263  .sp .6
 278  264  .RS 4n
 279  265  Allows the user to choose and alternative directory for cron to change
 280  266  directory to prior to running the command. For example:
 281  267  .sp
 282  268  .in +2
 283  269  .nf
 284  270  HOME=/var/tmp
 285  271  .fi
 286  272  .in -2
 287  273  .sp
 288  274  
 289  275  .RE
 290  276  
 291  277  .sp
 292  278  .ne 2
 293  279  .na
 294      -\fB\fBSHELL\fR\fR
      280 +\fBSHELL\fR
 295  281  .ad
 296  282  .sp .6
 297  283  .RS 4n
 298  284  The name of the shell to use to run subsequent commands. For example:
 299  285  .sp
 300  286  .in +2
 301  287  .nf
 302  288  SHELL=/usr/bin/ksh
 303  289  .fi
 304  290  .in -2
 305  291  .sp
 306  292  
 307  293  .RE
 308  294  
 309  295  .sp
 310  296  .ne 2
 311  297  .na
 312      -\fB\fBTZ\fR\fR
      298 +\fBTZ\fR
 313  299  .ad
 314  300  .sp .6
 315  301  .RS 4n
 316  302  Allows the user to choose the timezone in which the \fBcron\fR entries are run.
 317  303  This effects both the environment of the command that is run and the timing of
 318  304  the entry. For example, to have your entries run using the timezone for
 319  305  Iceland, use:
 320  306  .sp
 321  307  .in +2
 322  308  .nf
↓ open down ↓ 22 lines elided ↑ open up ↑
 345  331  .sp
 346  332  .LP
 347  333  If some form of \fBdaylight savings\fR or \fBsummer/winter time\fR is in
 348  334  effect, then jobs scheduled during the switchover period could be executed
 349  335  once, twice, or not at all.
 350  336  .SH OPTIONS
 351  337  The following options are supported:
 352  338  .sp
 353  339  .ne 2
 354  340  .na
 355      -\fB\fB-e\fR\fR
      341 +\fB-e\fR
 356  342  .ad
 357  343  .RS 6n
 358  344  Edits a copy of the current user's \fBcrontab\fR file, or creates an empty file
 359  345  to edit if \fBcrontab\fR does not exist. When editing is complete, the file is
 360  346  installed as the user's \fBcrontab\fR file.
 361  347  .sp
 362  348  The environment variable \fBEDITOR\fR determines which editor is invoked with
 363  349  the \fB-e\fR option. All \fBcrontab\fR jobs should be submitted using
 364  350  \fBcrontab\fR. Do not add jobs by just editing the \fBcrontab\fR file, because
 365  351  \fBcron\fR is not aware of changes made this way.
↓ open down ↓ 3 lines elided ↑ open up ↑
 369  355  file using the \fB-r\fR option.
 370  356  .sp
 371  357  If \fIusername\fR is specified, the specified user's \fBcrontab\fR file is
 372  358  edited, rather than the current user's \fBcrontab\fR file. This can only be
 373  359  done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
 374  360  .RE
 375  361  
 376  362  .sp
 377  363  .ne 2
 378  364  .na
 379      -\fB\fB-l\fR\fR
      365 +\fB-l\fR
 380  366  .ad
 381  367  .RS 6n
 382  368  Lists the \fBcrontab\fR file for the invoking user. Only root or a user with
 383  369  the \fBsolaris.jobs.admin\fR authorization can specify a username following the
 384  370  \fB-l\fR option to list the \fBcrontab\fR file of the specified user.
 385  371  .RE
 386  372  
 387  373  .sp
 388  374  .ne 2
 389  375  .na
 390      -\fB\fB-r\fR\fR
      376 +\fB-r\fR
 391  377  .ad
 392  378  .RS 6n
 393  379  Removes a user's \fBcrontab\fR from the \fBcrontab\fR directory. Only root or a
 394  380  user with the \fBsolaris.jobs.admin\fR authorization can specify a username
 395  381  following the \fB-r\fR option to remove the \fBcrontab\fR file of the specified
 396  382  user.
 397  383  .RE
 398  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 +
 399  397  .SH EXAMPLES
 400  398  \fBExample 1 \fRCleaning up Core Files
 401  399  .sp
 402  400  .LP
 403  401  This example cleans up \fBcore\fR files every weekday morning at 3:15 am:
 404  402  
 405  403  .sp
 406  404  .in +2
 407  405  .nf
 408  406  \fB15 3 * * 1-5 find $HOME\fR \fB-name\fR\fBcore 2>/dev/null | xargs rm\fR \fB-f\fR
↓ open down ↓ 104 lines elided ↑ open up ↑
 513  511  Korn shell. The file concludes with \fBTZ\fR, \fBHOME\fR, and \fBSHELL\fR
 514  512  entries that return those variable to their default values.
 515  513  
 516  514  .SH ENVIRONMENT VARIABLES
 517  515  See \fBenviron\fR(5) for descriptions of the following environment variables
 518  516  that affect the execution of \fBcrontab\fR: \fBLANG\fR, \fBLC_ALL\fR,
 519  517  \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
 520  518  .SS "\fB/usr/bin/crontab\fR"
 521  519  .ne 2
 522  520  .na
 523      -\fB\fBEDITOR\fR\fR
      521 +\fBEDITOR\fR
 524  522  .ad
 525  523  .RS 10n
 526  524  Determine the editor to be invoked when the \fB-e\fR option is specified. This
 527  525  is overridden by the \fBVISUAL\fR environmental variable. The default editor is
 528  526  \fBvi\fR(1).
 529  527  .RE
 530  528  
 531  529  .sp
 532  530  .ne 2
 533  531  .na
 534      -\fB\fBPATH\fR\fR
      532 +\fBPATH\fR
 535  533  .ad
 536  534  .RS 10n
 537  535  The \fBPATH\fR in \fBcrontab\fR's environment specifies the search path used to
 538  536  find the editor.
 539  537  .RE
 540  538  
 541  539  .sp
 542  540  .ne 2
 543  541  .na
 544      -\fB\fBVISUAL\fR\fR
      542 +\fBVISUAL\fR
 545  543  .ad
 546  544  .RS 10n
 547  545  Determine the visual editor to be invoked when the \fB-e\fR option is
 548  546  specified. If \fBVISUAL\fR is not specified, then the environment variable
 549  547  \fBEDITOR\fR is used. If that is not set, the default is \fBvi\fR(1).
 550  548  .RE
 551  549  
 552  550  .SS "\fB/usr/xpg4/bin/crontab\fR"
 553  551  .ne 2
 554  552  .na
 555      -\fB\fBEDITOR\fR\fR
      553 +\fBEDITOR\fR
 556  554  .ad
 557  555  .RS 10n
 558  556  Determine the editor to be invoked when the \fB-e\fR option is specified. The
 559  557  default editor is \fB/usr/xpg4/bin/vi\fR.
 560  558  .RE
 561  559  
 562  560  .SS "\fB/usr/xpg6/bin/crontab\fR"
 563  561  .ne 2
 564  562  .na
 565      -\fB\fBEDITOR\fR\fR
      563 +\fBEDITOR\fR
 566  564  .ad
 567  565  .RS 10n
 568  566  Determine the editor to be invoked when the \fB-e\fR option is specified. The
 569  567  default editor is \fB/usr/xpg6/bin/vi\fR.
 570  568  .RE
 571  569  
 572  570  .SH EXIT STATUS
 573  571  The following exit values are returned:
 574  572  .sp
 575  573  .ne 2
 576  574  .na
 577      -\fB\fB0\fR\fR
      575 +\fB0\fR
 578  576  .ad
 579  577  .RS 6n
 580  578  Successful completion.
 581  579  .RE
 582  580  
 583  581  .sp
 584  582  .ne 2
 585  583  .na
 586      -\fB\fB>0\fR\fR
      584 +\fB>0\fR
 587  585  .ad
 588  586  .RS 6n
 589  587  An error occurred.
 590  588  .RE
 591  589  
 592  590  .SH FILES
 593  591  .ne 2
 594  592  .na
 595      -\fB\fB/etc/cron.d\fR\fR
      593 +\fB/etc/cron.d\fR
 596  594  .ad
 597  595  .RS 28n
 598  596  main cron directory
 599  597  .RE
 600  598  
 601  599  .sp
 602  600  .ne 2
 603  601  .na
 604      -\fB\fB/etc/cron.d/cron.allow\fR\fR
      602 +\fB/etc/cron.d/cron.allow\fR
 605  603  .ad
 606  604  .RS 28n
 607  605  list of allowed users
 608  606  .RE
 609  607  
 610  608  .sp
 611  609  .ne 2
 612  610  .na
 613      -\fB\fB/etc/default/cron\fR\fR
      611 +\fB/etc/default/cron\fR
 614  612  .ad
 615  613  .RS 28n
 616  614  contains cron default settings
 617  615  .RE
 618  616  
 619  617  .sp
 620  618  .ne 2
 621  619  .na
 622      -\fB\fB/etc/cron.d/cron.deny\fR\fR
      620 +\fB/etc/cron.d/cron.deny\fR
 623  621  .ad
 624  622  .RS 28n
 625  623  list of denied users
 626  624  .RE
 627  625  
 628  626  .sp
 629  627  .ne 2
 630  628  .na
 631      -\fB\fB/var/cron/log\fR\fR
      629 +\fB/var/cron/log\fR
 632  630  .ad
 633  631  .RS 28n
 634  632  accounting information
 635  633  .RE
 636  634  
 637  635  .sp
 638  636  .ne 2
 639  637  .na
 640      -\fB\fB/var/spool/cron/crontabs\fR\fR
      638 +\fB/var/spool/cron/crontabs\fR
 641  639  .ad
 642  640  .RS 28n
 643  641  spool area for \fBcrontab\fR
 644  642  .RE
 645  643  
 646  644  .SH ATTRIBUTES
 647  645  See \fBattributes\fR(5) for descriptions of the following attributes:
 648  646  .SS "\fB/usr/bin/crontab\fR"
 649  647  
 650  648  .TS
↓ open down ↓ 64 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX