首页 > 服务器 > SSH常用的命令

SSH常用的命令

2009年03月23号
查看评论 发表评论 1,345次浏览

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退出编辑。

页面: 1 2 3 4 5

类别服务器 标签
  1. 高手
    发表于 2009年03月31号 12时29分22秒 | 1楼

    使用SCP文件内部传送:
    scp 文件名 root@IP:路径

  2. paul smith Scarves
    发表于 2010年06月24号 02时04分37秒 | 2楼

    This is a fine example.

  3. nike airforce
    发表于 2010年06月25号 20时53分11秒 | 3楼

    Hi I just came across quest experience I am looking forward to reading it tomorrow

  4. Herve Leger Dresses
    发表于 2010年06月26号 21时52分29秒 | 4楼

    Thanks online editor. We love it.

  5. timberland 6 inch boots
    发表于 2010年07月01号 11时27分54秒 | 5楼

    How comforting for you

  6. Mens Lacoste Shoes
    发表于 2010年07月10号 13时28分45秒 | 6楼

    Even though it will not be here tomorrow, the effect of it will.

  7. timberland boot
    发表于 2010年07月19号 20时52分22秒 | 7楼

    A nice life you have described

  8. lebron 6
    发表于 2010年07月20号 09时32分19秒 | 8楼

    I think you are right.

  9. MBT Walking Shoes
    发表于 2010年07月25号 14时35分43秒 | 9楼

    I was just scanning this posting and was reminded of what I once read.

  1. 目前没有通告