【发布时间】:2013-01-10 17:02:34
【问题描述】:
我有一个简单的 shell 脚本,在终端中打开时运行良好,但根本不会作为 cron 作业运行!
脚本如下:
#!/bin/sh
/usr/bin/sshfs example.com: /mnt
/usr/bin/rsync -az -v --progress -h --delete /mnt/html/ /home/user/html/
/bin/fusermount -u /mnt
这不起作用的任何原因? 我是 Ubuntu 和 Cron 的新手,所以这可能很简单。
谢谢! (我通过 cron GUI 添加了作业,“计划任务”)
【问题讨论】:
-
日志中有任何信息吗?
-
任务是添加到基于用户的 crontab 还是根目录?
-
@BobS 目前它在基于用户的 crontab 中,但我也尝试过 root 的。
-
@CarlNorum 日志每次输出一条消息“Grandchild failed with exit status 1”
-
您可能需要将
#/bin/sh更改为#/bin/bash
标签: linux bash shell ubuntu cron