1. 程式人生 > >指令碼批量修改acl

指令碼批量修改acl

cat  chown.sh

#!/bin/bash

table_name=$1
data_base=$2
cd /var/lib/hadoop-hdfs

cat ${table_name}|while read line
do
        hdfs dfs -chown -R hdfs                    /hive/warehouse/${data_base}/$line
        hdfs dfs -setfacl -R -m group:test:rwx  /hive/warehouse/${data_base}/$line
                             
done 

 bash -x chown.sh table.txt test.db

cat table.txt

test