Script Permissions


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script Permissions
# 8  
Old 07-24-2012
Here is the error from the script:

perl -p -i -e s/dqa014sa/ds3014sa/ /opt/hd/eg/qa/serial/el/wcs_oms_7od1/main/oms_database_config_prev.msg
Can't remove /opt/hd/eg/qa/serial/el/wcs_oms_7od1/main/oms_database_config_prev.msg: Permission denied, skipping file.

i tried sed and got the same error
sed -i "s/$v1/$db2/" $dbn1
Harleyrci
# 9  
Old 07-24-2012
Code:
ls -ld /opt/hd/eg/qa/serial/el/wcs_oms_7od1/main/

# 10  
Old 07-25-2012
This may be because editing in-place is prone to delete then re-create the files. You may have permission to write to the files but do you have permission to delete them?
# 11  
Old 07-25-2012
Perhaps another process is holding on to the file or even still writing to the file:

What do you get for:
Code:
fuser /opt/hd/eg/qa/serial/el/wcs_oms_7od1/main/oms_database_config_prev.msg

date
ls -ald /opt/hd/eg/qa/serial/el/wcs_oms_7od1/main/oms_database_config_prev.msg
ls -ald /opt/hd/eg/qa/serial/el/wcs_oms_7od1/main/


What precisely and exactly do you type to run your script? Is cron involved?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script for mkdir with permissions

Hello, I'm pretty new to scripting and trying to do a simple (well, I thought so) administrator task. I'm using bash. I want to create 10 directories under the one directory and apply permissions at the same time. I've worked out the make directories part: mkdir /userdata/folder{1..50}... (7 Replies)
Discussion started by: jimothy007
7 Replies

2. Shell Programming and Scripting

Help on script to change permissions

Hi All I have the following script that is supposed to change permissions of incoming files to a directory, but it does not seem to do what I want, please can you help: mkdir -p /tmp/tmpdir find /moneta_polled01/sgsn/ -exec ls -l {} \; |grep -v rwxrwxrwx |awk '{print $9}' >... (4 Replies)
Discussion started by: fretagi
4 Replies

3. Shell Programming and Scripting

Help on script to change permissions

Hi I have written the following script that later I want to put in cron,: #!/bin/bash _find="/usr/bin/find" _paths="/moneta_polled01/mediation_gsm /moneta_polled01/mediation_mmsc" for d in $_paths do $_find $d -type f -exec chmod 777 {} \; done but it does not seem to be... (8 Replies)
Discussion started by: fretagi
8 Replies

4. 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

5. Shell Programming and Scripting

Permissions script

Hi there, I've been having some frustrating problems with a permissions script. Basically I want it to to determine what permissions the owner, group and everybody has for the file passed in. Here's what I've got: #!bin/bash echo -n "Enter filename: " read file owner=$( ls -l $file | cut... (7 Replies)
Discussion started by: user_invalid
7 Replies

6. Shell Programming and Scripting

Call other script having different Permissions

Oops, infact i caught my mistake.... (1 Reply)
Discussion started by: suhail.sadaqat
1 Replies

7. UNIX for Dummies Questions & Answers

Permissions to files using batch script.

Hi all, I am using a batch script that ftps the compressed xml files to the Unix environment from the Windows environment and i perform this using the below line of coding: echo cd %VAR_TR_FTP_DIR% > %TR_FTP_BATCH_FILE BatchNum% Echo lcd "%VAR_TR_SOURCE_PATH_BatchNum%">> %TR_FTP_BATCH_FILE... (1 Reply)
Discussion started by: Codesearcher
1 Replies

8. UNIX for Dummies Questions & Answers

Changing permissions in a shell script

Hi All, I have a shell script which we keep on changing permissions on a On-Demand Basis-->for e:g--from 400(Read only) to 740(Execute permission) etc. Is there any way by which I can view the history of the script?-->I am interested in finding out the date-time stamps when the script's... (2 Replies)
Discussion started by: DevotedPupil
2 Replies

9. Shell Programming and Scripting

Modify Perl script to work with txt - Permissions script

Hi I have this code, and i want work with a ls -shalR output in .txt What i need read to do this?? Where start? #!/usr/bin/perl # Allrights- A perl tool for making backups of file permissions # Copyright (C) 2005 Norbert Klein <norbert@acodedb.com> # This program is free... (1 Reply)
Discussion started by: joangopan
1 Replies

10. Shell Programming and Scripting

Shell script permissions

Hi, I'm trying to execute a shell script from application (Informatica). The script works fine when I execute it from command line but fails when executed from Informatica. The tricky part is that there is other scripts in the same folder that can be executed succesfully from both command line... (1 Reply)
Discussion started by: tmikahan
1 Replies
Login or Register to Ask a Question