permissions to create log file from script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting permissions to create log file from script
# 1  
Old 06-08-2009
permissions to create log file from script

hi all,
have a script which i am using to generate a log file. i use "touch out.log" command to create the file and later on i want to echo lines to this file.

for some reason it keeps giving me this error when i try and create the file ;

touch: out.log cannot create

i have permissions to create files in the directory where my script sits since its my home directory. so i dont understand what else is wrong ??

directory permissions where my script sits is "drwxr-xr-x"


thanks.
# 2  
Old 06-09-2009
Are you able to create files with other commands?
since you told you want to echo in that file, try to redirect the echo into the file.

Code:
echo "message" >> out.log

and see if it works.
# 3  
Old 06-09-2009
It looks as permission problem. Check the permission of directoty where you run.
ls -l .
# 4  
Old 06-09-2009
Maybe, u'r not the owner of that file. You can use "chmod +w" to modify the permission of the file
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Script for adding users to file permissions

I need a script to add the following two users ids to the permissions for various files: IIS_WPG and IUSR_CowGirl. I am fairly familiar with scripting but haven't been able to figure out how to do this via a script. Manually doing it is slow. I don't want to create users but only add them to a... (2 Replies)
Discussion started by: Stu Loventhal
2 Replies

2. Web Development

Mac. PHP. fopen( ) does not create a file. Permissions.

Thank you to those who responded. After a crazy amount of troubleshooting and getting hints and feedback from others, I was so darn determined to get on with my tutorials and I found the solution myself. Keyword search: php and 'Mac computer' and fopen and chmod. Using: php and Mac and... (2 Replies)
Discussion started by: iHaveAQuestion
2 Replies

3. Shell Programming and Scripting

Mac. PHP fopen() does not create a file. Permissions.

5Thank you to those who responded. After a crazy amount of troubleshooting and getting hints and feedback from others, I was so darn determined to get on with my tutorials and I found the solution myself. Keyword search: php and 'Mac computer' and fopen and chmod. Using:php and Mac and... (1 Reply)
Discussion started by: iHaveAQuestion
1 Replies

4. HP-UX

How to create a user in UNIX with some limited permissions?

As i know, Unix or Linux only manages 2 type of user: root user or normal user. All users with userID=0 will have all administration permissions like root user with the system. In my case, i want to create a new user in HP-UNIX environment with all root permissions only one exception that this... (5 Replies)
Discussion started by: hieucn1404
5 Replies

5. Shell Programming and Scripting

Create archive and nil the content of log file using script

Plese help I need a urgent requirement. Ex: test.log requirement : using shell script I need to archive the log file and nil and the content of (test.log) file to 0 kb and then in the archive folder log files are name to test.tar test1.tar test2.tar EX: /home/abc/ test.log ... (1 Reply)
Discussion started by: johney1981
1 Replies

6. Shell Programming and Scripting

Create duplicate directories with same permissions

Hi all, I need to create duplicate directories and sub directories (only the directories not the files or file contents) with the same permissions. Can some one guide me in doing this. I could able to create but here the permissions should be the same how can i do this in linux. Thanks in... (5 Replies)
Discussion started by: Olivia
5 Replies

7. Shell Programming and Scripting

How to check file permissions from a script.

hello, I have to write a script to run the other script inside it.So iam planning to write like this? first check the perimissions of the file. Alogorthim ---------- if(!filepermissions == execute) then echo" Permissions denined" else execute the script. file name is : load_mf.sh... (1 Reply)
Discussion started by: rajkumar_g
1 Replies

8. Shell Programming and Scripting

Script to find the user of a file and permissions

I have a list of files in a.txt file. For each of the files listed in that file, I would like to obtain the owner of the file and also, the permissions associated with that file. If possible, the group the owner belongs to as well. Can someone help me with a script to find that out. (1 Reply)
Discussion started by: ggayathri
1 Replies

9. Shell Programming and Scripting

How to create a log file of a script?

hi, How to create a log file of a script. Like spool does . I want to create a log file of whatever the script is doing step wise. like -xvf does or something better then that. thanks ... (3 Replies)
Discussion started by: madfox
3 Replies

10. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies
Login or Register to Ask a Question