How can I run a script to create 400 Quota trees at one time?
We are starting a migration and have 12,000 User Home Directories and 400 Departmental directories. For the User directories, we are using user based quotas. For the Departmental directories we want to use Tree quotas and create the directories and quotas before we start the migration.
Using Putty.exe from the CLI, I can run the following to create the Quota tree (which creates the folder) :
nas_quotas -on -tree -fs Data1 -path /treequotatest -comment 'this is a test'
Next I can run the following to set the quota limit:
create a text file that contains a list of departments and save is as "departments.txt" , for example:
hr
marketing
management
then from command line run:
DEP=`cat departments.txt`
for i in $DEP
do
echo "Creating directory for $i"
nas_quotas -on -tree -fs Data1 -path "$i" -comment 'this is a test'
done
i don't think there is another way to reference quota id's but output from nas_quotas -list -tree -fs and nas_quotas -report -tree -fs will help you script your nas_quotas -report -tree -fs command.
Thanks, now we are getting somewhere. I did use filezilla logged in with the same username and password and i was able to copy files to:
home/username Which is where my command prompt defaults to using putty.
It looks like it is reading the file now, but I got another error:
Error 13431603213: Control char: Invalid Tree Quota path character. A tree quota path on a Data Mover that does not have Unicode enabled must use ASCII characters only.
I tried twice with the following in my text file and got the same results:
/treetesta /treetestb /treetestc
and
/treetest1 /treetest2 /treetest3
The commands i am running are:
[admin@NAS1 ~]$ DEP=`cat departments.txt`
[admin@NAS1 ~]$ for i in $DEP; do nas_quotas -on -tree -fs Data1 -path "$i"; done
I searched for unicode, ascii in the documentation and havent found really anything not even how to enable it or what that will affect. Can't find anything on that error code. I am currently searching info on invalid ascii characters.I created the txt file in windows notepad and it is saved as ANSI which seems to be ascii from what I read so far...
It looks like it is reading the file now, but I got another error:
Error 13431603213: Control char: Invalid Tree Quota path character. A tree quota path on a Data Mover that does not have Unicode enabled must use ASCII characters only.
I would also suggest to check if your CIFS servers are configured with Unicode support - just do a server_cifs server_2 and see what I18N mode says
server_checkup server_2 -test CIFS will also look for it
without it you cant use non-ASCII characters for Objects like shares and so on
dynamox
11 Legend
•
20419 Posts
•
87439 Points
1387
0
Posted January 27th, 2010 06:00
let's make sure there are no control characters in your "departments.txt" file. On control station run this command:
dos2unix departments.txt
now try your comand again.