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