lightweight
lightweight

Reputation: 3327

persist permissions to all files in directory HDFS

I am trying to do a chmod 755 on all the directories and files in an HDFS directory but it wont persist all the way down.

for example, if I have a directory like this:

/home/set1/data1/file1.txt

I need to do this so my app can access it:

haddop fs -chmod 755 /home/set1/*
haddop fs -chmod 755 /home/set1/data1/*
haddop fs -chmod 755 /home/set1/data1/file*
haddop fs -chmod 755 /home/set1/data2/*
haddop fs -chmod 755 /home/set1/data2/file*
haddop fs -chmod 755 /home/set1/data3/*
haddop fs -chmod 755 /home/set1/data3/file*

how do I get the permission to set for each directory and file in the path in HDFS?

Upvotes: 6

Views: 17456

Answers (1)

Manjunath Ballur
Manjunath Ballur

Reputation: 6343

Use "-R" (Recursive) option.

hadoop fs -chmod -R 755 /home/set1/data1/

Upvotes: 10

Related Questions