I have changed the tmp directory permissions to give full access to anyone and this still fails. And the weird thing is this is a portion of a previous job that has run on 160+ servers without fail and from the same BigFix server.
Completed delete __appendfile
Completed appendfile "Test file written {now}"
Completed delete "/tmp/temp.bash"
Completed continue if {not exists file "/tmp/temp.bash"}
Failed copy __appendfile "/tmp/temp.bash"
continue if {exists file "/tmp/temp.bash"}
We can see that /tmp/temp.bash either didn’t exist or was deleted so the failed copy means you either don’t have rights to create & write to /tmp/temp.bash or can’t read __appendfile.
Next options to troubleshoot.
Put auditing on /tmp/ to see the errors
Try the same script but trying to create a differently named file in a different folder.
I’d also try it using createfile instead of appendfile to create the initial content
Just copy another file you know exists to /tmp/temp.bash
Auditing is the process of logging successful/unsuccessful file operations (be they read, write, create, delete, etc. etc.). You would do this to see what work/fails when creating/writing files in the folder.
I don’t know which OS you are using or the details of running it, so I’m not going to attempt to give you the instructions. Google is probably you friend for that.
So I just wanted to drop by on this thread I started to give you an update.
The folks that said I probably did not have the “rights” to write to the directory were correct. I was using a new Linux test lab server. This server is a SELinux box which is Linux OS with a higher level of security. When I switch to the standard RedHat Linux, the script worked fine. So thanks for trying to help.
TM: could you explain a little bit about turning on auditing?
More specifically, on many 'nixes the file at /bin/sh might be sh, or a copy of /bin/bash, or a link to /bin/bash. This comes into play because bash has hard-coded behaviors that are different if the binary is launched using the name “sh”.
If Bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well.