Crontab schedule

3 views
Skip to first unread message

Dominique C.F.

unread,
Sep 14, 2009, 4:27:53 PM9/14/09
to vmsbackup
Hi, I'm having problems with scheduling the script in crontab. At the
time it was suposed to run, nothing happens. Does anyone know how to
do it?

10nico

unread,
Sep 19, 2009, 4:15:39 AM9/19/09
to vmsbackup
Hello Dominique, the problem might be the user your crontab entry is
being run with.
The script should be scheduled to run as the root user.

Or, it might be some problem with the environment variables which, in
some cases, are missing or incomplete (or different from those of the
real root user).

But first try to schedule the script to be run as root, then le us
know how it turns out.

Regards,

Michele

On 14 Set, 22:27, "Dominique C.F." <dominiquecarva...@gmail.com>
wrote:

Dominique C.F.

unread,
Sep 20, 2009, 1:20:08 PM9/20/09
to vmsbackup
Same thing, scheduled to be run as root as youo sugested, but it
doesn't work.

I'm useing CentOS 5.3 x86.

When I run the script via comand line it works fine. But not within
cron
> > do it?- Ocultar texto das mensagens anteriores -
>
> - Mostrar texto das mensagens anteriores -

10nico

unread,
Sep 21, 2009, 3:46:58 AM9/21/09
to vmsbackup
I have a similar machine here at work, I'll try to reproduce the
problem and report back to you as soon as I get some info on the
problem.

Have a nice day,

Michele


On Sep 20, 7:20 pm, "Dominique C.F." <dominiquecarva...@gmail.com>
wrote:

10nico

unread,
Sep 21, 2009, 11:20:39 AM9/21/09
to vmsbackup
Hello again, I've tracked the problem down.
Apparently the CentOS crontab sets predefined values for crucial
environment variables such as $HOME

Also it runs the script from the / directory, instead of from the
user's home directory, and this causes the script to fail because it
doesn't find the backup_vmware.conf script.

But you can overcome this problem by preceding the script command with
some instructions, separated by semicolons, in the crontab entry:

# runs backup_vmware script to backup the Virtual Machines every night
at 22:00
0 22 * * * root cd /root; source /root/.bash_profile; /root/
backup_vmware3.12a.sh -D -s hot -f lzop

I've tried this and it works ok.

Hope this fixes your problem!

Regards,

Michele

Dominique C.F.

unread,
Sep 23, 2009, 10:13:04 PM9/23/09
to vmsbackup
Hi Michele.

All I can say is that........ YOU REALLY ROCK....
; )

it worked perfectly, don't even have words to thank you all for all
this that you do

Its a really nice project..

Thanks for all, I hope that this last a long long time.
> > > > - Mostrar texto das mensagens anteriores -- Ocultar texto das mensagens anteriores -
Reply all
Reply to author
Forward
0 new messages