Print this page
13066 Want crontab -u
Change-ID: I3dc2251dbbcc721aeff25a9dde21a24271c927bc
   1 CRONTAB(1)                       User Commands                      CRONTAB(1)
   2 
   3 
   4 
   5 NAME
   6        crontab - user crontab file
   7 
   8 SYNOPSIS
   9        /usr/bin/crontab [filename]
  10 
  11 
  12        /usr/bin/crontab -e [username]
  13 
  14 
  15        /usr/bin/crontab -l [username]
  16 
  17 
  18        /usr/bin/crontab -r [username]
  19 
  20 
  21        /usr/xpg4/bin/crontab [filename]
  22 
  23 
  24        /usr/xpg4/bin/crontab -e [username]
  25 
  26 
  27        /usr/xpg4/bin/crontab -l [username]
  28 
  29 
  30        /usr/xpg4/bin/crontab -r [username]
  31 
  32 
  33        /usr/xpg6/bin/crontab [filename]
  34 
  35 
  36        /usr/xpg6/bin/crontab -e [username]
  37 
  38 
  39        /usr/xpg6/bin/crontab -l [username]
  40 
  41 
  42        /usr/xpg6/bin/crontab -r [username]
  43 
  44 
  45 DESCRIPTION
  46        The crontab utility manages a user's access with cron (see cron(1M)) by
  47        copying, creating, listing, and removing crontab files. If invoked
  48        without options, crontab copies the specified file, or the standard
  49        input if no file is specified, into a directory that holds all users'
  50        crontabs.
  51 
  52 
  53        If crontab is invoked with filename, this overwrites an existing
  54        crontab entry for the user that invokes it.

  55 
  56    crontab Access Control
  57        Users: Access to crontab is allowed:
  58 
  59            o      if the user's name appears in /etc/cron.d/cron.allow.
  60 
  61            o      if /etc/cron.d/cron.allow does not exist and the user's name
  62                   is not in /etc/cron.d/cron.deny.
  63 
  64 
  65        Users: Access to crontab is denied:
  66 
  67            o      if /etc/cron.d/cron.allow exists and the user's name is not
  68                   in it.
  69 
  70            o      if /etc/cron.d/cron.allow does not exist and user's name is
  71                   in /etc/cron.d/cron.deny.
  72 
  73            o      if neither file exists, only a user with the
  74                   solaris.jobs.user authorization is allowed to submit a job.


 242              If username is specified, the specified user's crontab file is
 243              edited, rather than the current user's crontab file. This can
 244              only be done by root or by a user with the solaris.jobs.admin
 245              authorization.
 246 
 247 
 248        -l
 249              Lists the crontab file for the invoking user. Only root or a user
 250              with the solaris.jobs.admin authorization can specify a username
 251              following the -l option to list the crontab file of the specified
 252              user.
 253 
 254 
 255        -r
 256              Removes a user's crontab from the crontab directory. Only root or
 257              a user with the solaris.jobs.admin authorization can specify a
 258              username following the -r option to remove the crontab file of
 259              the specified user.
 260 
 261 







 262 EXAMPLES
 263        Example 1 Cleaning up Core Files
 264 
 265 
 266        This example cleans up core files every weekday morning at 3:15 am:
 267 
 268 
 269          15 3 * * 1-5 find $HOME -namecore 2>/dev/null | xargs rm -f
 270 
 271 
 272 
 273        Example 2 Mailing a Birthday Greeting
 274 
 275 
 276        This example mails a birthday greeting:
 277 
 278 
 279          0 12 14 2 * mailx john%Happy Birthday!%Time for lunch.
 280 
 281 


 468        last step takes time, especially with a large crontab file, and can
 469        complete after an existing crontab entry is scheduled to run if it is
 470        scheduled too close to the update. To be safe, start a new job at least
 471        60 seconds after the current date and time.
 472 
 473 
 474        If an authorized user other than root modifies another user's crontab
 475        file, the resulting behavior can be unpredictable. Instead, the
 476        authorized user should first use su(1M) to become superuser to the
 477        other user's login before making any changes to the crontab file.
 478 
 479 
 480        Care should be taken when adding TZ, SHELL and HOME variables to the
 481        crontab  file when the crontab file could be shared with applications
 482        that do not expect those variables to be changed from the default.
 483        Resetting the values to their defaults at the bottom of the file will
 484        minimize the risk of problems.
 485 
 486 
 487 
 488                                October 22, 2019                     CRONTAB(1)
   1 CRONTAB(1)                       User Commands                      CRONTAB(1)
   2 
   3 
   4 
   5 NAME
   6        crontab - user crontab file
   7 
   8 SYNOPSIS
   9        /usr/bin/crontab [-u username] [filename]
  10 
  11 
  12        /usr/bin/crontab { -e | -l | -r } [username]
  13 
  14 
  15        /usr/bin/crontab -u username { -e | -l | -r }
  16 
  17 



  18        /usr/xpg4/bin/crontab [filename]
  19 
  20 
  21        /usr/xpg4/bin/crontab { -e | -l | -r } [username]
  22 
  23 
  24        /usr/xpg4/bin/crontab -u username { -e | -l | -r }
  25 
  26 



  27        /usr/xpg6/bin/crontab [filename]
  28 
  29 
  30        /usr/xpg6/bin/crontab { -e | -l | -r } [username]
  31 
  32 
  33        /usr/xpg6/bin/crontab -u username { -e | -l | -r }
  34 
  35 



  36 DESCRIPTION
  37        The crontab utility manages a user's access with cron (see cron(1M)) by
  38        copying, creating, listing, and removing crontab files. If invoked
  39        without options, crontab copies the specified file, or the standard
  40        input if no file is specified, into a directory that holds all users'
  41        crontabs.
  42 
  43 
  44        If crontab is invoked with filename, this overwrites an existing
  45        crontab entry for the user that invokes it, or for the user specified
  46        with the -u option.
  47 
  48    crontab Access Control
  49        Users: Access to crontab is allowed:
  50 
  51            o      if the user's name appears in /etc/cron.d/cron.allow.
  52 
  53            o      if /etc/cron.d/cron.allow does not exist and the user's name
  54                   is not in /etc/cron.d/cron.deny.
  55 
  56 
  57        Users: Access to crontab is denied:
  58 
  59            o      if /etc/cron.d/cron.allow exists and the user's name is not
  60                   in it.
  61 
  62            o      if /etc/cron.d/cron.allow does not exist and user's name is
  63                   in /etc/cron.d/cron.deny.
  64 
  65            o      if neither file exists, only a user with the
  66                   solaris.jobs.user authorization is allowed to submit a job.


 234              If username is specified, the specified user's crontab file is
 235              edited, rather than the current user's crontab file. This can
 236              only be done by root or by a user with the solaris.jobs.admin
 237              authorization.
 238 
 239 
 240        -l
 241              Lists the crontab file for the invoking user. Only root or a user
 242              with the solaris.jobs.admin authorization can specify a username
 243              following the -l option to list the crontab file of the specified
 244              user.
 245 
 246 
 247        -r
 248              Removes a user's crontab from the crontab directory. Only root or
 249              a user with the solaris.jobs.admin authorization can specify a
 250              username following the -r option to remove the crontab file of
 251              the specified user.
 252 
 253 
 254        -u username
 255              Specifies the name of the user whose crontab is to be replaced,
 256              viewed or modified. This can only be done by root or by a user
 257              with the solaris.jobs.admin authorization.
 258 
 259 
 260 
 261 EXAMPLES
 262        Example 1 Cleaning up Core Files
 263 
 264 
 265        This example cleans up core files every weekday morning at 3:15 am:
 266 
 267 
 268          15 3 * * 1-5 find $HOME -namecore 2>/dev/null | xargs rm -f
 269 
 270 
 271 
 272        Example 2 Mailing a Birthday Greeting
 273 
 274 
 275        This example mails a birthday greeting:
 276 
 277 
 278          0 12 14 2 * mailx john%Happy Birthday!%Time for lunch.
 279 
 280 


 467        last step takes time, especially with a large crontab file, and can
 468        complete after an existing crontab entry is scheduled to run if it is
 469        scheduled too close to the update. To be safe, start a new job at least
 470        60 seconds after the current date and time.
 471 
 472 
 473        If an authorized user other than root modifies another user's crontab
 474        file, the resulting behavior can be unpredictable. Instead, the
 475        authorized user should first use su(1M) to become superuser to the
 476        other user's login before making any changes to the crontab file.
 477 
 478 
 479        Care should be taken when adding TZ, SHELL and HOME variables to the
 480        crontab  file when the crontab file could be shared with applications
 481        that do not expect those variables to be changed from the default.
 482        Resetting the values to their defaults at the bottom of the file will
 483        minimize the risk of problems.
 484 
 485 
 486 
 487                                 August 20, 2020                     CRONTAB(1)