Evening all,
Got a quick question. Suppose you have a huge amount of data that you
need to keep in sync between two systems. Running one session of
rsync is taking a long time. I am attempting to break up the rsync
session and have a separate rsync session per directory.
I would ideally like to start these rsync sessions in a staggered
manner to avoid killing the system. The cron module does have a way to
spread the tasks if they are running on different hosts, but I can't
for the life of me figure out how to get it to generate random time
depending on the directories name. Anyone done this before?
Below is what the task would look, but want to replace the seed if possible.
- name: cron jobs to trigger cron backup for tools directories
cron: name="{{item}}" hour="{{23
random(seed=inventory_hostname)}}" minute="{{59 |random}}" user=root
job="/usr/local/bin/{{item}}_backup.sh > /dev/null"
cron_file={{item}}
with_items:
- '{{tools_directories}}'
Regards,
William