Solaris: crontab usage (bad)

Source: Internet
Author: User

To be honest, I really don't like Solaris. It's so uncomfortable to use it. The key is that it won't be used.

In Linux/FreeBSD, the syntax for viewing the current crontab task is crontab-l, and the task for editing a user is crontab-u <username>-e

However, in Solaris, crontab does not have the-u parameter. crontab: Proper usage is:
Crontab [user]

If you are interested, try it. It is very difficult to use.

Of course, here I want to confess to everyone that I don't understand Solaris. The reason for complaints is that its operations differ greatly from what I know. To put it short, let me introduce my experience:

1. Stop the crontab service.
Shell>/etc/init. d/cron stop

2. Edit crontab in two ways

[First] (recommended)
Directly edit the crontab file of the corresponding user under/var/spool/cron/crontabs/. If no crontab file exists, create a new one with the user name. However, you should use Vim to edit it. The default VI editor of Solaris is not vim.

[2]
Using the command crontab-E <User Name>, I still don't know how to use it. The lessons learned are: Ctrl + D is to save and exit the editing mode, CTRL + Z: Do not save and exit the editing mode. Once Ctrl + D, all the original crontab content will be replaced, so be sure to perform the operation with caution.

3. Start the crontab service.
Shell>/etc/init. d/cron start

4. supplement the command usage in Solaris. This is from the Internet and I think it is necessary to explain it.

# Crontab-l root can view the crontab task list of the root user.

To execute a task once every 20 minutes, you can write it as follows:
0, 20, 40 *** command

To execute a task once every five minutes, you can write it as follows:
0, 5, 10, 15, 20, 25, 30, 35, 40, 4, 50, 55 *** command

Crontab in Solaris is different from that in Linux.
*/5 indicates every 5 minutes
*/20 indicates every 20 minutes
Solaris does not support

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.