Error 0403-005
Found an error 0403-005 Cannot create the specified file when I tried to output some text to a file.
[oracle@primary01 oracle]$ echo "Hello!" >> /home/oracle/scripts/logs/temp.log
A file or directory in the path name does not exist.
ksh: /home/oracle/scripts/logs/temp.log: 0403-005 Cannot create the specified file.
Error 0403-005 means that the path you provided in the command is not valid. Theoretically, the output file will be created at run-time if there's none. That is to say, the problem is not from the file temp.log, the problem is from the path /home/oracle/scripts/logs.
To test the validity of the path, we can try to list it.
[oracle@primary01 oracle]$ ls -l /home/oracle/scripts/logs
ls: 0653-341 The file /home/oracle/scripts does not exist.
As you can see, 0653-341 told us that the path is invalid.
To solve it, we should create the directory to make the path valid.
[oracle@primary01 oracle]$ mkdir -p /home/oracle/scripts/logs
Now we can execute the command successfully.