Re: Shell Script Help

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



LIMIT=10 # Or whatever
sleep `expr $RANDOM % $LIMIT + 1`

-----Original Message-----
From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] On Behalf Of Matt
Sent: 05 September 2013 16:25
To: CentOS mailing list
Subject:  Shell Script Help

I have a script file in my cron.hourly that contains a good number of scripts I must call.

#!/bin/sh

sleep 15
perl /scripts/create_graph.pl &

sleep 15
perl /scripts/create_graph_out.pl &

many more lines. etc.

Is there a way I can sleep random length to time before executing each but background each one so master script returns promptly.  Something like.

sleep (random 1 - 300 seconds, perl /scripts/create_graph_out.pl) & _______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com ______________________________________________________________________

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3392 / Virus Database: 3211/6618 - Release Date: 08/28/13 Internal Virus Database is out of date.

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux