Debian Crontab

2007-01-27 5:52 am
Excuse me ,
I want to ask why my cron don't have any response?
I set as
crontab -e

then
0 0 * * * /home/shutdown.sh

my debian is 3.1

the content of shutdown.sh is
and it is set to chmod 755
can anyone tell me how to activate cron?
#! /bin/bash
#
#
# Version: @(#)reboot 2.75 22-Jun-1998 [email protected]
#

modprobe apm
poweroff
P.s Was using Fedora for previous version(in RUn LEVEL 3)

回答 (1)

2007-02-01 5:39 am
✔ 最佳答案
1. 先打 ps ax | grep cron 檢查下你無start cron daemon, 無野睇請打 /etc/init.d/cron start

2. 你無比 modprobe 同 poweroff 的 full path,大部份Unix/Linux 行 cron 個 $PATH 都會好簡單, 所以我地習慣寫 script, 每個 command 都會寫 full path, 亦可以 confirm , cron 真係行左你所指定既 command, 你可以睇下各GNU/Linux上既 script, 幾乎所有都會寫 fullpath command。請改成:

#!/bin/bash

/sbin/modprobe apm
/sbin/poweroff


收錄日期: 2021-04-18 20:45:05
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070126000051KK03799

檢視 Wayback Machine 備份