Copy command not working

Hello All,

I’m using below action script but script is always getting failed while copying the content, Please suggest

appendfile cp /var/opt/BESClient/__BESData/__Global/__Download/svcsnow.txt /var/spool/cron/tabs
appendfile cp /var/opt/BESClient/__BESData/__Global/__Download/snowagent.config /opt/snow
copy __appendfile Snow.sh
wait chmod 555 Snow.sh
wait bash Snow.sh

Since the copy command will fail if the destination file exists, it is generally a good practice to include a delete command prior. Perhaps something like the following might work better (if not, Client logs can help troubleshoot):

delete __appendfile
delete Snow.sh

appendfile cp /var/opt/BESClient/__BESData/__Global/__Download/svcsnow.txt /var/spool/cron/tabs
appendfile cp /var/opt/BESClient/__BESData/__Global/__Download/snowagent.config /opt/snow

move __appendfile Snow.sh
wait chmod 555 Snow.sh
wait bash Snow.sh

All that said, why not copy the given files via standard actionscript (https://developer.bigfix.com/action-script/reference/file/copy.html) rather than creating a shell script?

2 Likes

Actually normal move or copy command is not seems to be working and that is the reason I have created script in shell format.