LinuxQuestions.org
Review your favorite Linux distribution.
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, 05: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, 05:33 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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, 06: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 04:41 AM
[SOLVED] folder Permission 9199 Linux - Newbie 6 08-09-2012 10:09 AM
nfs server - sharing folder - folder permission dlugasx Linux - Server 1 02-15-2011 12:30 AM
how create a folder/permission rusmi Linux - Newbie 7 02-11-2005 10:04 AM
Folder permission javamdk Slackware 9 07-07-2004 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:23 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
Open Source Consulting | Domain Registration