rdiff-backup-users
[Top][All Lists]
Advanced

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

Re: [rdiff-backup-users] Problem with Detection of Multiple rdiff-backup


From: Dominic Raferd
Subject: Re: [rdiff-backup-users] Problem with Detection of Multiple rdiff-backup instances
Date: Fri, 25 Sep 2009 16:37:34 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Jakob Unterwurzacher wrote:
in bash:

#!/bin/bash
for i in `seq 1 $((RANDOM%100))`; do /bin/true; done


But you should make sure that $RANDOM assumes different values after a
reboot (same for perl's rand(100), which is likely more advanced and
less likely to suffer from that problem).

Jakob
this can be done by prefixing your 'for' line with:

RANDOM=$(($(date +%s) % 32768))

this seeds the random number generator based on the number of seconds since 1/1/70, so is likely to avoid repeats.

Dominic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]