SCIENTIFIC-LINUX-USERS Archives

July 2011

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
carlopmart <[log in to unmask]>
Reply To:
carlopmart <[log in to unmask]>
Date:
Mon, 25 Jul 2011 19:48:43 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
On 07/25/2011 07:10 PM, Nico Kadel-Garcia wrote:
> On Mon, Jul 25, 2011 at 8:46 AM, carlopmart<[log in to unmask]>  wrote:
>> Hi all,
>>
>>   I have configured a cron task to start certain virtual machines when kvm
>> host starts at a certain runlevel (3 or 4). My script:
>>
>> #!/bin/sh
>>
>> which_rulevel=`runlevel | awk '{print $2}'`
>>
>> if [ "$which_rulevel" == 3 ]; then
>>         sleep 60
>>         virsh start vmfw01
>>         sleep 140
>>         virsh start vmfw02
>> elif [ "$which_rulevel" == 4 ]; then
>>         sleep 60
>>         virsh start vmfw03
>> fi
>>
>>   .. And my cron task is located under /etc/cron.d with the following config
>> file:
>>
>> SHELL=/bin/bash
>> PATH=/sbin:/bin:/usr/sbin:/usr/bin
>> MAILTO=""
>> HOME=/
>
> Hold it. None of this is necessary, and a blank $MAILTO can cause
> issues. MAILTO should point to an actual email address, not be set
> blank, if you need it. And why are you resetting $SHELL and $PATH?
> Yoou should only need those if you use non-standard values.
>
>> @reboot * * * * root /root/bin/launch_vms
>
> You have a syntax problem: @reboot, @hourly, etc. replace all the
> tiime selection fields in crontab. What you probably want is:
>
>      @reboot     root    /root/bin/launch_vms
>

Thanks Nico, that was the problem ...


-- 
CL Martinez
carlopmart {at} gmail {d0t} com

ATOM RSS1 RSS2