Advertisement
eXTA

Untitled

Jan 26th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.84 KB | None | 0 0
  1. root@ubuntu:/home/test# bash -x /etc/procurve-bup.sh -o /mnt/Backup/Test/
  2. + set -e
  3. + set -u
  4. + readonly PROGNAME=procurve-bup
  5. + PROGNAME=procurve-bup
  6. + readonly LOG_FACILITY=user
  7. + LOG_FACILITY=user
  8. + declare quiet=
  9. + main -o /mnt/Backup/Test/
  10. + local _outdir=
  11. + local _create_archive=
  12. ++ date +%a
  13. + local _now_day=Tue
  14. + local _tfname=.switchbup-10395
  15. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  16. ++ command -v sshpass
  17. + [[ -z /usr/bin/sshpass ]]
  18. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  19. ++ command -v readlink
  20. + [[ -z /bin/readlink ]]
  21. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  22. ++ command -v scp
  23. + [[ -z /usr/bin/scp ]]
  24. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  25. ++ command -v rm
  26. + [[ -z /bin/rm ]]
  27. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  28. ++ command -v chmod
  29. + [[ -z /bin/chmod ]]
  30. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  31. ++ command -v logger
  32. + [[ -z /usr/bin/logger ]]
  33. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  34. ++ command -v mkdir
  35. + [[ -z /bin/mkdir ]]
  36. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  37. ++ command -v grep
  38. + [[ -z /bin/grep ]]
  39. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  40. ++ command -v ln
  41. + [[ -z /bin/ln ]]
  42. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  43. ++ command -v mv
  44. + [[ -z /bin/mv ]]
  45. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  46. ++ command -v diff
  47. + [[ -z /usr/bin/diff ]]
  48. + for cmd in sshpass readlink scp rm chmod logger mkdir grep ln mv diff tar
  49. ++ command -v tar
  50. + [[ -z /bin/tar ]]
  51. ++ guess_config_fname
  52. ++ [[ -e ./procurve-bup.conf ]]
  53. ++ [[ -e /root/.procurve-bup.conf ]]
  54. ++ [[ -e /etc/procurve-bup.conf ]]
  55. ++ echo /etc/procurve-bup.conf
  56. ++ return 0
  57. + local _config_fname=/etc/procurve-bup.conf
  58. + getopts :haqc:o: opt
  59. + case $opt in
  60. + _outdir=/mnt/Backup/Test/
  61. + getopts :haqc:o: opt
  62. + [[ -z /mnt/Backup/Test/ ]]
  63. + [[ -z /etc/procurve-bup.conf ]]
  64. + [[ ! -f /etc/procurve-bup.conf ]]
  65. + [[ ! -r /etc/procurve-bup.conf ]]
  66. ++ readlink -f /etc/procurve-bup.conf
  67. + _config_fname=/etc/procurve-bup.conf
  68. + [[ ! -d /mnt/Backup/Test/ ]]
  69. + cd /mnt/Backup/Test/
  70. + read name addr user method value
  71. + grep -P '^\s*[^#;]' /etc/procurve-bup.conf
  72. + [[ -z main-switch ]]
  73. + [[ -z 192.168.0.88 ]]
  74. + [[ -z root ]]
  75. + [[ -z password ]]
  76. + case "$method" in
  77. + pw=password
  78. + pubkey=
  79. + [[ -z password ]]
  80. + log_notice 'Backing up main-switch (192.168.0.88)'
  81. + log2syslog notice '' 'Backing up main-switch (192.168.0.88)'
  82. + local _priority=notice
  83. + local _quiet=
  84. + local '_msg=Backing up main-switch (192.168.0.88)'
  85. + local _logger_args=
  86. + [[ -n '' ]]
  87. + _logger_args=-sit
  88. + logger -sit procurve-bup -p user.notice -- Backing up main-switch '(192.168.0.88)'
  89. procurve-bup[10413]: Backing up main-switch (192.168.0.88)
  90. + [[ ! -d main-switch ]]
  91. + pushd main-switch
  92. + failed=0
  93. + for cfg in startup-config running-config
  94. + case "$method" in
  95. + log_notice 'Fetching '\''startup-config'\'' via SSH using password auth'
  96. + log2syslog notice '' 'Fetching '\''startup-config'\'' via SSH using password auth'
  97. + local _priority=notice
  98. + local _quiet=
  99. + local '_msg=Fetching '\''startup-config'\'' via SSH using password auth'
  100. + local _logger_args=
  101. + [[ -n '' ]]
  102. + _logger_args=-sit
  103. + logger -sit procurve-bup -p user.notice -- Fetching ''\''startup-config'\''' via SSH using password auth
  104. procurve-bup[10414]: Fetching 'startup-config' via SSH using password auth
  105. + scp_using_password [email protected] password /cfg/startup-config .switchbup-10395
  106. + local password=password
  107. + local remote_file=/cfg/startup-config
  108. + local local_file=.switchbup-10395
  109. + local '_ssh_opts=-q -o PubkeyAuthentication=no -o PasswordAuthentication=yes'
  110. ++ mktemp
  111. + local _tfile=/tmp/tmp.fBvFDRPUJ6
  112. + chmod 600 /tmp/tmp.fBvFDRPUJ6
  113. + echo password
  114. + failed=0
  115. + sshpass -f /tmp/tmp.fBvFDRPUJ6 scp -q -o PubkeyAuthentication=no -o PasswordAuthentication=yes [email protected]:/cfg/startup-config .switchbup-10395
  116. + rm -f /tmp/tmp.fBvFDRPUJ6
  117. + return 0
  118. + [[ -f .switchbup-10395 ]]
  119. + chmod 440 .switchbup-10395
  120. + ln -f .switchbup-10395 startup-config
  121. + mv -f .switchbup-10395 main-switch_Tue_startup-config
  122. + sleep 5
  123. + for cfg in startup-config running-config
  124. + case "$method" in
  125. + log_notice 'Fetching '\''running-config'\'' via SSH using password auth'
  126. + log2syslog notice '' 'Fetching '\''running-config'\'' via SSH using password auth'
  127. + local _priority=notice
  128. + local _quiet=
  129. + local '_msg=Fetching '\''running-config'\'' via SSH using password auth'
  130. + local _logger_args=
  131. + [[ -n '' ]]
  132. + _logger_args=-sit
  133. + logger -sit procurve-bup -p user.notice -- Fetching ''\''running-config'\''' via SSH using password auth
  134. procurve-bup[10425]: Fetching 'running-config' via SSH using password auth
  135. + scp_using_password [email protected] password /cfg/running-config .switchbup-10395
  136. + local password=password
  137. + local remote_file=/cfg/running-config
  138. + local local_file=.switchbup-10395
  139. + local '_ssh_opts=-q -o PubkeyAuthentication=no -o PasswordAuthentication=yes'
  140. ++ mktemp
  141. + local _tfile=/tmp/tmp.CtBYc6jT4B
  142. + chmod 600 /tmp/tmp.CtBYc6jT4B
  143. + echo password
  144. + failed=0
  145. + sshpass -f /tmp/tmp.CtBYc6jT4B scp -q -o PubkeyAuthentication=no -o PasswordAuthentication=yes [email protected]:/cfg/running-config .switchbup-10395
  146. + rm -f /tmp/tmp.CtBYc6jT4B
  147. + return 0
  148. + [[ -f .switchbup-10395 ]]
  149. + chmod 440 .switchbup-10395
  150. + ln -f .switchbup-10395 running-config
  151. + mv -f .switchbup-10395 main-switch_Tue_running-config
  152. + sleep 5
  153. + [[ 0 -eq 0 ]]
  154. + diff -q startup-config running-config
  155. + popd
  156. + read name addr user method value
  157. + [[ -n '' ]]
  158. + exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement