|
什么是经典?我认为这个就是!向作者致敬!
其简洁程度正是我们所追求的,我一直用的都是这个,虽然是94年的东东...
总共只有两个文件:
- root@domain:~# ls /mnt/lfs/usr/bin/cron* -l
- -rwxr-x--- 1 root root 14888 Jan 1 08:00 /mnt/lfs/usr/bin/crond
- -rwxr-x--- 1 root root 10020 Jan 1 08:00 /mnt/lfs/usr/bin/crontab
- root@domain:~#
复制代码
看看 README 吧
- CREDITS
- I finally got tired of all of these wild cron programs that take the
- task of running timed jobs to ridiculous extremes in terms of
- capabilities and unnecessary features. So here is my entry: a
- crond/crontab combination that is simple and elegant, and hopefully
- secure to boot. This cron implements reasonable features in terms
- of field specification in the crontab and allows individual user
- crontabs.
- This program is written entirely from scratch by yours Truely (sig
- at bottom).
- All jobs are run with /bin/sh for conformity and portability, thereby
- avoiding the mess that occurs with other cron's that try to use the
- user's perfered shell, which breaks down for special users and even makes
- some of us normal users unhappy (for example, /bin/csh does not use a true
- O_APPEND mode and has difficulty redirecting stdout and stderr both to
- different places!). You can, of course, run shell scripts in whatever
- language you like by making them executable with #!/bin/csh or whatever
- as the first line. If you don't like the extra processes, just 'exec'
- them.
- Under the same reasoning, this cron does not allow you to specify
- environment variables or other stuff better left specified as
- arguments to a shell script. Talk about nonsense!
- The programs were written with an eye towards security, hopefully I
- haven't forgotton anything. The programs were also written with an
- eye towards nice, clean, algorithmically sound code. It's small, and
- the only fancy code is that which deals with child processes. I do
- not try to optimize with vfork() since it causes headaches and is
- rather pointless considering I'm execing a shell most of the time,
- and I pay close attention to leaving descriptors open in the crond
- and close attention to preventing crond from running away.
复制代码
请去掉附件 txt 扩展名。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|