LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2015, 06:28 PM   #1
apss_evaluator
Member
 
Registered: Mar 2012
Posts: 115

Rep: Reputation: Disabled
check folder permission


Hi Linux Guru's

I am trying to compose a bash script that will run applications automatically but 1st it the pgdata should be in proper permissions to 0700

here is the directory I'm telling that should always be 0700 before the startup of apps

[pogi@server gwaping]$ ls -ltrh /hoy/ | grep pgdata
drwx------+ 15 postgres postgres 4.0K May 23 12:36 pgdata
 
Old 06-24-2015, 06:33 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

you don't ask a question, but perhaps the following will point you in the right direction:

Code:
ar=$(stat -c %a /hoy/pgdata)
if [ "$ar" != "700" ] ; then
  echo "Error: directory has wrong permissions"
  exit 1
fi
HTH,

Evo2.
 
1 members found this post helpful.
Old 06-24-2015, 07:01 PM   #3
apss_evaluator
Member
 
Registered: Mar 2012
Posts: 115

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
Hi,

you don't ask a question, but perhaps the following will point you in the right direction:

Code:
ar=$(stat -c %a /hoy/pgdata)
if [ "$ar" != "700" ] ; then
  echo "Error: directory has wrong permissions"
  exit 1
fi
HTH,

Evo2.
Thanks Evo2, it worked
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File & Folder Permission and Ownership permission error in Cloud storage. rhcekumaran Linux - Newbie 3 06-14-2013 05:41 AM
[SOLVED] folder Permission 9199 Linux - Newbie 6 08-09-2012 11:09 AM
nfs server - sharing folder - folder permission dlugasx Linux - Server 1 02-15-2011 01:30 AM
how create a folder/permission rusmi Linux - Newbie 7 02-11-2005 11:04 AM
Folder permission javamdk Slackware 9 07-07-2004 12:26 PM


All times are GMT -5. The time now is 09:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration