1 2 Previous Next 22 Replies Latest reply on Oct 1, 2010 8:40 AM by Jason B

    Copy file from TARGET_HOST back to central BL cluster



      At the end of a nsh script I am trying to cat a file created on each target_host back to the central BL cluster where I will end up with a single file.


      Two problems, I try and touch a file so it exists, and then the cat refuses to accept the variables as part of the remote log file name.


      touch "$LOCAL_TEMP_DIR/ServerReboots.log"

      cat "$REMOTE_TEMP_DIR/$TARGET_HOST_reboot.log" >> "$LOCAL_TEMP_DIR/ServerReboots.log"


      I have also tried;


      cat "$REMOTE_TEMP_DIR/$TARGET_HOST_reboot.log >> $LOCAL_TEMP_DIR/ServerReboots.log"


      I get these errors:

      Error Oct 1, 2010 12:20:17 PM Audit of target part 'Server Reboot Status//EventLogInfo/Rebooted' failed on target 'LONS00108200': touch: /Demo/Extobj/tmp/vbs/ServerReboots.log: No such file or directory


      Why ?  this is just a standard command so the file 'does' exists ?!

      Unable to append to file /Demo/Extobj/tmp/vbs/ServerReboots.log: No such file or directory
      cat: //LONS00108200/tmp/vbs/.log: No such file or directory


      So, how do I reference a variable as part of a string. In bash you would, for example do this;




      To not mix the variable with the string making it an unrecogniseable variable name.  In nsh it just returns {hostname} WITH the brackets.


      I can not find a reference to dealing with variables within scripts, the the nsh guide shows the commands only.  Is there such a document ?






        1 2 Previous Next