HP-UX UNIX: Start / Stop and Configure Cron Services

HP-UX UNIX: Start / Stop and Configure Cron Services

On an HP-UX Unix system, the "cron" daemon is used to schedule and execute tasks (also known as cron jobs) at regular intervals. The "cron" daemon is usually started at boot time and runs in the background to execute tasks according to the crontab files.

To start, stop, or configure the "cron" daemon on HP-UX, you can use the following commands:

  1. To start the "cron" daemon, use the following command:
/sbin/init.d/cron start
Sour‮‬ce:www.lautturi.com
  1. To stop the "cron" daemon, use the following command:
/sbin/init.d/cron stop
  1. To restart the "cron" daemon, use the following command:
/sbin/init.d/cron restart
  1. To check the status of the "cron" daemon, use the following command:
/sbin/init.d/cron status
  1. To edit the global crontab file (which contains tasks that are executed by all users), use the following command:
crontab -e
  1. To edit the crontab file for a specific user, use the following command:
crontab -u username -e

Replace "username" with the name of the user.

  1. To list the tasks in the global crontab file, use the following command:
crontab -l
  1. To list the tasks in the crontab file for a specific user, use the following command:
crontab -u username -l

Note: The "cron" daemon reads the crontab files every minute and executes the tasks that are scheduled to run at that time. Each line in the crontab file represents a task, and consists of six fields: minute, hour, day of month, month, day of week, and the command to be executed. For example, to execute a task every day at 2:00 AM, you can use the following line in the crontab file:

0 2 * * * /path/to/command

For more information about the syntax and usage of the crontab files, you can refer to the "crontab" man page or online documentation.

Created Time:2017-10-29 22:08:30  Author:lautturi