Commit 4fe7449d authored by remy's avatar remy
Browse files

updating salt command for borgbackup cmd to set it as '--static' + using printf instead of echo

parent 0bca91ce
......@@ -110,8 +110,8 @@ salt '*' grains.get kernelrelease --static --out=json |grep -v " did not respond
############################## BORGBACKUP STATUS #####################################
# UNCOMMENT NEXT LINES TO USE IT
#nb_lines=`/usr/bin/salt '*' cmd.run 'if [ -f /var/log/borg/$(date +"%Y%m%d".json) ] ;then if [ -s /var/log/borg/$(date +"%Y%m%d".json) ]; then echo "/var/log/borg/$(date +"%Y%m%d".json):"; sed -e "s|^}|}\n},|" /var/log/borg/$(date +"%Y%m%d".json); else echo "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"borgbackup report file found but is empty!\" \n},"; fi; else echo "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"No borgbackup report file found!\" \n},"; fi' |grep -v " did not respond. No job will be sent."|wc -l`
#/usr/bin/salt "*" cmd.run 'if [ -f /var/log/borg/`date +"%Y%m%d".json` ] ;then if [ -s /var/log/borg/$(date +"%Y%m%d".json) ]; then echo "/var/log/borg/$(date +"%Y%m%d".json):"; sed -e "s|^}|}\n},|" /var/log/borg/`date +"%Y%m%d".json`; else echo "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"borgbackup report file found but is empty!\" \n},"; fi; else echo "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"No borgbackup report file found!\" \n},"; fi' |grep -v " did not respond. No job will be sent." | \
#nb_lines=`/usr/bin/salt '*' cmd.run 'if [ -f /var/log/borg/$(date +"%Y%m%d".json) ] ;then if [ -s /var/log/borg/$(date +"%Y%m%d".json) ]; then printf "\"/var/log/borg/$(date +"%Y%m%d".json)\":"; sed -e "s|^}|}\n},|" /var/log/borg/$(date +"%Y%m%d".json); else printf "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"borgbackup report file found but is empty!\" \n},"; fi; else printf "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"No borgbackup report file found!\" \n},"; fi' --static |grep -Ev " did not respond. No job will be sent.|Minion did not return"|wc -l`
#/usr/bin/salt "*" cmd.run 'if [ -f /var/log/borg/`date +"%Y%m%d".json` ] ;then if [ -s /var/log/borg/$(date +"%Y%m%d".json) ]; then printf "\"/var/log/borg/$(date +"%Y%m%d".json)\":"; sed -e "s|^}|}\n},|" /var/log/borg/`date +"%Y%m%d".json`; else printf "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"borgbackup report file found but is empty!\" \n},"; fi; else printf "\"/var/log/borg/$(date +"%Y%m%d".json)\": \"No borgbackup report file found!\" \n},"; fi' --static |grep -Ev " did not respond. No job will be sent.|Minion did not return"| \
#awk -v last=$nb_lines '{
# if ( NR == 1 ) {
# gsub(/[ :]/, "", $0);print "{\n\"borg_status\": {\n\t\""$0"\": {";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment