Add a deterministic sleep to spread out the load and lets run it at night in test
This commit is contained in:
parent
2c974bd178
commit
1654186ddc
3 changed files with 5 additions and 2 deletions
|
@ -114,7 +114,7 @@ define sunetdrive::app_type (
|
|||
command => '/usr/local/bin/scan_external_mounts',
|
||||
user => 'root',
|
||||
minute => '20',
|
||||
hour => '10',
|
||||
hour => '1',
|
||||
}
|
||||
}
|
||||
file { '/opt/nextcloud/cron.sh':
|
||||
|
|
|
@ -59,7 +59,7 @@ class sunetdrive::multinode (
|
|||
command => '/usr/local/bin/scan_external_mounts',
|
||||
user => 'root',
|
||||
minute => '20',
|
||||
hour => '10',
|
||||
hour => '1',
|
||||
}
|
||||
}
|
||||
file { '/usr/local/bin/nocc':
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#!/bin/bash
|
||||
# We sleep a deterministic amount of time, which will be between 0 an 128 m and allways the same within
|
||||
# a specific host, but will differ between hosts
|
||||
sleep $((16#$(ip a | grep "link/ether" | head -1 | awk -F ':' '{print $6}' | awk '{print $1}') / 2))m
|
||||
|
||||
# Only run if this is the only instance of this script running
|
||||
# note: since this script forks to run pgrep, we need -eq 2 here
|
||||
|
|
Loading…
Add table
Reference in a new issue