SSH常用的命令
3. Crontab 定时执行任务
在SSH系统下, 通过Shell可以建立自己的crontab. 具体使用如下:
使用支持shell登录的终端(如fterm或putty), 地址栏输入username@qiran.org:22即可以SSH方式登录至服务器.
常用的crontab命令:
crontab -l 显示所有现存cron job.
crontab -r 删除当前cron jobs.
crontab -e 编辑当前 “crontab file”. DH推荐使用nano
注意你的crontab包含所有的cron jobs, 每个cron一行, 断行结尾. 一个正常的cron如下所示:
45 2 * * * /home/user/scrīpt.pl
第一个数字是每小时的第几分钟,
第二个数字是每天的第几小时,
第三个数字是每月的第几天,
第四个数字是每年的第几月,
第五个数字是每周的第几天.
使用方式例如:
32 * * * * : 表示每小时的第32分钟.
12,42 * * * * : 表示每小时的第12及第42分钟两次
*/15 */2 * * *: 表示0:00, 0:15, 0:30, 0:45, 2:00, 2:15, 2:30, …
43 18 * * 7: 表示每个周日的6:43pm运行命令行.
在SSH下使用nano编辑完文件后,使用ctrl+o保存,ctrl+x退出编辑。
使用SCP文件内部传送:
scp 文件名 root@IP:路径
This is a fine example.
Hi I just came across quest experience I am looking forward to reading it tomorrow
Thanks online editor. We love it.
How comforting for you
Even though it will not be here tomorrow, the effect of it will.
A nice life you have described
I think you are right.
I was just scanning this posting and was reminded of what I once read.