In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces how the crontab setting example of squid rotate under solaris is. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
Cron is the main scheduling process in solaris system, which can run jobs without human intervention. Crontab commands allow users to submit, edit, or delete jobs. The system administrator forbids or allows users to own their own crontab files through cron.deny and cron.allow files. Cron.allow indicates who can use the crontab command. If it is an empty file, no user can schedule a job. If this file does not exist and there is another file, cron.deny, only users who are not included in this file can use the crontab command. If it is an empty file, it indicates that any user can schedule a job. Cron.allow takes precedence when two files exist at the same time, and if neither exists, only the superuser can schedule jobs.
Recently, a rotation log has been set on the server, and the specific operations are as follows:
# export EDITOR=vi
# crontab-e (can also be modified directly: / var/spool/cron/crontabs/root)
# 00 * * 1 / usr/local/squid/sbin/squid-f / usr/local/squid/etc/squid.conf.external-k rotate > / dev/null 2 > & 1
# 00 * * 1 / usr/local/squid/sbin/squid-f / usr/local/squid/etc/squid.conf.internal-k rotate > / dev/null 2 > & 1
# 00 * * 1 / usr/local/squid/sbin/squid-f / usr/local/squid/etc/squid.conf.reverse-k rotate > / dev/null 2 > & 1
Split the log at 0: 00 every Monday and block the information output.
# wq!
# crontab-l output verifies whether it is edited correctly
# ps-ef | grep cron
# kill-9 324
# rm / etc/cron.d/FIFO
# / usr/sbin/cron
Or stop and restart the cron process through / etc/init.d/crond stop and / etc/init.d/crond start.
The process of this operation is simply explained: first, set the environment variable default editor to vi, if you do not set this, there will be extra numbers when using crontab-e and cannot call the vi editor. Add log rotation setting statements and mask standard output information. Find the cron process and end it, delete the FIFO file (otherwise prompted), and finally restart the cron process.
Note: if you cannot edit the crontab file, please check to see if there is a current user in / etc/cron.d/cron.allow and make sure that there is no account you are currently using in / etc/cron.d/cron.deny.
Finally, do a verification, a week or two or three weeks later to see if there is a split log. As shown in the figure:
On the solaris squid rotate crontab configuration example is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.