[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cron problem!



谢谢大家的热心答复.

我想应该不是权限的问题,因为我是用root登录, 然后crontab -e; 而且当那个script执行的时候, 我用 ps -u root 可
以看到它的进程.


在 2005-03-10四的 15:16 +0900,Yan, Zheng写道:
> try change like this:
> 
> 15  18   *    *    *    root /usr/local/bin/full_backup.sh 
> 
> Cai Qian wrote:
> 
> >照你所说,我第一个想到的可能是权限问题。
> >
> >在 2005-03-09三的 14:04 -0600,Hongbo Ma写道:
> >  
> >
> >>I wrote a script called full_backup.sh to do bakcup. It is supposed to
> >>run at a given time everyday. I log in as root, and type "crontab -e"
> >>add a entry like following to the crontab file:
> >>*******************************
> >>15  18   *    *    *    /usr/local/bin/full_backup.sh 
> >>********************************
> >>
> >>
> >>The content of the full_backup.sh (I put it under /usr/local/bin) is:
> >>
> >>******************************************
> >>#!/bin/sh
> >>mt -f /dev/nst0 rewind
> >>
> >>rm /var/log/tar/snapshot
> >>
> >>tar -cvpf /dev/nst0 --label="Full Backup Set Created
> >>on `date '+%d-%B-%y'`." --listed-incremental=/var/log
> >>/tar/snapshot /home/hma/project
> >>*******************************************
> >>
> >>I can run this script with no problem manually and get my archive file
> >>on tape. However, if I use cron, although it IS  triggered by cron, the
> >>'tar' command in the script didn't run successfully. That is to say, I
> >>know the script was executed by checking the consequence of
> >>"rm /var/log/tar/snapshot", but I didn't get the archive file on tape.
> >>
> >>Strangely, if I changed the backup target directory from  the
> >>"/home/hma/project" to "home/hma/proposal", then every thing is fine. I
> >>get the archive file on tape. "proposal" directory is about 3MB, while
> >>"project" directory is about 700MB. But the size should not be a
> >>problem, since I can manually run the script to backup "project"
> >>correclty.
> >>
> >>Obiousely, something is wrong with my cron, but I just don't know how to
> >>correct it. Currently, I don't have sendmail program installed on my
> >>system, so I can't get the email cron is supposed to send to me. 
> >>
> >>Any help is highly appreciated!!
> >>
> >>Hongbo Ma
> >>
> >>
> >>    
> >>
> >
> >
> >  
> >
-- 
Hongbo Ma <hma@wisc.edu>
University of Wisconsin at Madison



Reply to: