Re: [CentOS] Any one have a good example...

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



Scott Silva wrote:
...of a shell script for rsync that won't start again if it is already running?
I thought of using a lock file, but what if it is killed mid script or bombs?

You write your PID to the lock file, then in startup, you check if the lock file exist and if the PID process is running, then it is still active.

It could be that the process is just hung, so this method will only help assure that you do not start a second copy.

--

//Morten Torstensen
//Email: morten@xxxxxxxxxxx
//IM: Cartoon@xxxxxxxxx morten.torstensen@xxxxxxxxx

And if it turns out that there is a God, I don't believe that he is evil.
The worst that can be said is that he's an underachiever.
_______________________________________________
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