Re: Pause a script

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

 



Hi,

"Mark Haney" <mhaney@xxxxxxxxxxxxxxxx> writes:

> Mircea Hutanu wrote:
>> On 2/6/07, Mark Haney <mhaney@xxxxxxxxxxxxxxxx> wrote:
>>> I have been trying for a bit to do something like this in cron:
>>>
>>> <script1><pause for 60 second>;<script2>
>>>
>> Why don't you try to put the scripts into one single main script and
>> put that main script into cron, for example.
>> #!/bin/bash
>> /path/to/script1
>> sleep 60s
>> /path/to/script2
>> Hope this helps you.
>>
>>
> I'm not sure this will help.  Here's the situation:
>
> script1 - checks for the existence of test.pid
> script2 - the job that actually will create the pid
>
> So if I do what you've suggested above, script1 will run and fail (I'll 
> get an email saying the PID didn't exist) then 60 seconds later script2 
> will run and create the pid.  Is that not how the sleep command works?
perhaps I do not understand your problem, but this may be a solution:

script1:

[ -r /tmp/k/pid ] &&  exit 1
exit 0


script2:

touch /tmp/k/pid


Call it:

script1 && sleep 60 && script2

Michael

-- 
biff4emacsen - A biff-like tool for (X)Emacs
http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux