由于时常要在机房上实验课,便想在机房远程自己的笔记本。
而且我们中学的ruijie是在8点能够认证的,于是便编撰了个手动执行的脚本linux计划任务执行url,在8点联接上ruijie。
环境:ubuntu12.04
首先,编撰一个脚本test.sh,保存在/home/nevermore目录linux计划任务执行url,代码如下:
#!/bin/sh
sudomentohust
echosuccess
这个脚本用于启动ruijie
接着,我们打开/etc/crontab,我们可以见到如下内容:
#mhdommondowusercommand
17****rootcd/&&run-parts--report/etc/cron.hourly
256***roottest-x/usr/sbin/anacron||(cd/&&run-parts--report/etc/cron.daily)
476**7roottest-x/usr/sbin/anacron||(cd/&&run-parts--report/etc/cron.weekly)
5261**roottest-x/usr/sbin/anacron||(cd/&&run-parts--report/etc/cron.monthly)
其中linux软件工程师培训,m代表分钟,h代表小时linux安全加固,dom为dayofmonthmon为月份dow为dayofweek,我们在最后一行添加如下代码:
108***rootsudo/home/nevermore/test.sh
代表系统将在每晚的8点10分执行该目录下的test.sh脚本。
哈哈,ok,到此就完成操作啦~~