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 4fee7b1042
commit c28c6ac91b
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
2 changed files with 13 additions and 0 deletions

View file

@ -55,6 +55,13 @@ class sunetdrive::multinode_db(){
group => 'root',
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':
cmd => '/root/tasks/genusersondepartmentlists.sh',
hour => '2',

View file

@ -2,6 +2,7 @@
<% basedir="statistics:drive-server-coms" -%>
<% cupath="/opt/mariadb/statistics/users/" -%>
<% custdata="/opt/mariadb/statistics/custdata.json" -%>
status=0
<% @custdata.each do |cust,data| -%>
@ -23,4 +24,9 @@ fi
<% 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}