建議可以看一下你的 crontab 裏面的幾個地方
1 script 的路徑
2 執行 cron 的是否一樣有權限像你在 command line 執行該 script
3 script 裏面是否需要 source ~/.bashrc 才能執行呢?
※ 引述《hardcover.bbs@ptt.cc (不可說不可說)》之銘言:
> 我每天要固定從log server上撈log 到我的desktop。
> log server只開放ssh。我寫了一個shell script來故這件事。
> 連到log server的方式是public key authentication。
> 直接執行這個script是正確可以取回log file,不過叫cron執行就有問題。
> cron的訊息是:
> Permission denied, please try again.
> Permission denied, please try again.
> Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
> 我己經把private key加到ssh-agent裡; ssh-add xxxx
> # get log file
> ....
> for i in logdir1 logdir2 logdir3 ...
> ...
> ...
> if $(ssh logman@$log_server test -e $src); then
> scp logman@$log_server:$src/201* $dst_dir/$i || \
> (echo "$i: honeynet copy failed !" && exit 1)
> else
> echo "$i: log files are not ready !"
> exit 1
> fi
> ...
> ---
> 我search了一下資料,不知是不是要用keychain?
> 我照search到的文章設了.profile 加上keychain ,變成gdm無法登入
> thanks
--
我是路過的路人
--
※ Origin: SayYA 資訊站 <bbs.sayya.org>
◆ From: 123-204-144-249.adsl.dynamic.seed.net.tw