Dump customer datastructure for statistics logic to be transferred to script1.

This commit is contained in:
Magnus Andersson 2024-09-09 16:18:00 +02:00 committed by Micke Nordin
parent a51cc9fdc4
commit f886d53f3c
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
3 changed files with 14 additions and 0 deletions

View file

@ -55,6 +55,13 @@ class sunetdrive::multinode_db(){
group => 'root', group => 'root',
mode => '0700', mode => '0700',
} }
file {'/opt/mariadb/statistics/custdata.json':
ensure => file,
content => template('sunetdrive/mariadb/custconfig.json.erb'),
owner => 'root',
group => 'root',
mode => '0600',
}
sunet::scriptherder::cronjob { 'genuserdeplists': sunet::scriptherder::cronjob { 'genuserdeplists':
cmd => '/root/tasks/genusersondepartmentlists.sh', cmd => '/root/tasks/genusersondepartmentlists.sh',
hour => '2', hour => '2',

View file

@ -0,0 +1 @@
<%= @custdata.to_json %>

View file

@ -2,6 +2,7 @@
<% basedir="statistics:drive-server-coms" -%> <% basedir="statistics:drive-server-coms" -%>
<% cupath="/opt/mariadb/statistics/users/" -%> <% cupath="/opt/mariadb/statistics/users/" -%>
<% custdata="/opt/mariadb/statistics/custdata.json" -%>
status=0 status=0
<% @custdata.each do |cust,data| -%> <% @custdata.each do |cust,data| -%>
@ -23,4 +24,9 @@ fi
<% end -%> <% end -%>
<% end -%> <% end -%>
if [[ -f <%= custdata %> ]]
then
timeout 30s rclone copy -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies <%= custdata %> <%= basedir%>/
fi
exit ${status} exit ${status}