genusersondepartmentlists: Add som logic for error handling
This commit is contained in:
parent
d8eaa122e3
commit
05bde6adb6
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
<% basedir="statistics:drive-server-coms" -%>
|
<% basedir="statistics:drive-server-coms" -%>
|
||||||
<% cupath="/opt/mariadb/statistics/users/" -%>
|
<% cupath="/opt/mariadb/statistics/users/" -%>
|
||||||
|
status=0
|
||||||
|
|
||||||
<% @custdata.each do |cust,data| -%>
|
<% @custdata.each do |cust,data| -%>
|
||||||
#Customer <%= cust %> has no billing departments.
|
#Customer <%= cust %> has no billing departments.
|
||||||
|
@ -13,6 +14,10 @@ chmod '0700' /opt/mariadb/statistics/users/<%= cust %>
|
||||||
if jq . <%= cupath + cust %>/users-<%= dom.gsub(/[.]/, '-') %>.json &>/dev/null
|
if jq . <%= cupath + cust %>/users-<%= dom.gsub(/[.]/, '-') %>.json &>/dev/null
|
||||||
then
|
then
|
||||||
timeout 30s rclone copy -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies <%= cupath + cust %>/users-<%= dom.gsub(/[.]/, '-') %>.json <%= basedir%>/<%= cust %>-<%= @environment%>/
|
timeout 30s rclone copy -c --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies <%= cupath + cust %>/users-<%= dom.gsub(/[.]/, '-') %>.json <%= basedir%>/<%= cust %>-<%= @environment%>/
|
||||||
|
[[ $? -eq 0 ]] || { status=1 ; echo "Error: Upload of user data failed." ; }
|
||||||
|
else
|
||||||
|
echo "Error in json data"
|
||||||
|
status=1
|
||||||
fi
|
fi
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
Loading…
Reference in a new issue