SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Problem with Detection of Multiple rdiff-backup instances
Author Message
Post Problem with Detection of Multiple rdiff-backup instances 
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


_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB