必不可少的,这就需要我们进行一下计划任务,编写到用户的计划任务当中。
以下是一个计划任务编辑并执行效果认证的的例子:
--- 计划任务:
--计划任务:每个3分钟将/home/home.text中的内容写到/home/oracle/orahome.text中:
[oracle@su ~]$ pwd
/home/oracle
[oracle@su ~]$ touch orahome.text
[oracle@su ~]$ cat orahome.text
[oracle@su ~]$
---查看/home/home.text的内容:
[oracle@su home]$ cat home.text
my heart will go on and on
HELLO,MYHOME #脦碌募脪脮
hello,myhome!
[oracle@su home]$
---查看计划任务:
[oracle@su ~]$
[oracle@su ~]$ crontab -l
*/3 * * * * /bin/cat /home/home.text>>/home/oracle/orahome.text
--查看时间:
[oracle@su ~]$ date
Wed Nov 9 22:23:56 CST 2016
--等到22:30分的时候,查看文件orahome.text的内容:
[oracle@su ~]$ date
Wed Nov 9 22:32:11 CST 2016
#时间已经到。
---查看文件orahome.text的内容。
[oracle@su ~]$
[oracle@su ~]$ cat orahome.text
my heart will go on and on
HELLO,MYHOME #脦碌募脪脮
hello,myhome!
my heart will go on and on
HELLO,MYHOME #脦碌募脪脮
hello,myhome!
my heart will go on and on
HELLO,MYHOME #脦碌募脪脮
hello,myhome!
[oracle@su ~]$
#可知已经写了3次了
可以看到,计划任务执行完毕。
这些任务都能在系统的后台进行中执行,达到自动化的效果。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31392094/viewspace-2128209/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31392094/viewspace-2128209/