In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about how to analyze the crontab file in Solaris. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
In the Solaris operating environment, / var/spool/cron/crontab/root is a crontab file created for root users. By default, ordinary users cannot have crontab files.
Root users include the following command line by default
# ident "@ (#) root1.1998/07/06SMI" / * SVr4.01.1.3.1*/
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
#
10 3 * * 0jue 4 / etc/cron.d/logchecker
10 3 * * 0 / usr/lib/newsyslog
15 3 * 0 / usr/lib/fs/nfs/nfsfind
1 2 * [- x / usr/sbin/rtc] & & / usr/sbin/rtc-c > / dev/null 2 > & 1
30 3 * [- x / usr/lib/gss/gsscred_clean] & &
/ usr/lib/gss/gsscred_clean
The explanations are as follows:
1. Rotate cron log
2. Rotation system log
3. NFS comes with it
4. Automatic timing
5 、 clean gsscred
Use crontab-l to display crontab files
To view the contents of the crontab file for root, execute the following command:
# crontab-l
If ordinary users can create their own crontab files, then users can also execute this command to view their own crontab files.
Root users can view any ordinary user's crontab file and run the following command:
# crontab-l username
Edit the crontab file
Create or edit the crontab file and perform these steps:
1. Check whether the EDITOR variable is set to the editor that the user wants to use. This tells cron which editor to use to open the file. such as
# EDITOR vi
# export EDITOR
2. Run the following crontab command to open the crontab file or add a line
# crontab-e
30 17 * * 5 / usr/bin/banner "Time to go!" > / dev/console
: wq
Control crontab access
There are two crontab files that control access to crontab files in the / etc/cron.d file: / etc/cron.d/cron.deny and / etc/cron.d/cron.allow
Note: deny is refused, allow is allowed (personal notes)
These files allow only specified users to perform crontab tasks, such as creating, editing, displaying or deleting their own crontab files.
The Solaris operating environment defaults to the existing cron.deny file. While cron.allow does not exist by default, all users (unless they are included in the cron.deny file) can access crontab. By creating the cron.allow file, you can list who can access the crontab command.
These two files are made up of user names, 1 per line. The following rules must be used:
If cron.allow exists, only users listed in this file can create, edit, display or delete crontab files.
If cron.allow does not exist, all users, unless they are included in cron.deny, can create, edit, display, and delete crontab files
If neither file exists, only root can run crontab.
Delete the crontab file.
The correct way to delete the crontab file is to call the command:
# crontab-r username
Ordinary users can delete their own crontab files; but root can delete any user's crontab files.
The above is how to analyze the crontab files in Solaris. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.