[K12OSN] home directory listing for teachers

Petre Scheie petre at maltzen.net
Tue Aug 15 13:37:37 UTC 2006


You could write a script that would make short work of it, like so:

mv /home/grade12 /home/grade.classof2006
mv /home/grade11 /home/grade12
mv /home/grade10 /home/grade11
mv /home/grade9 /home/grade10
...

and so on.  This is crude, inelegant script, but since you only have 12 grades, it 
wouldn't take long to write it.  OTOH, if you want to be clever and have it handled 
through a loop:

mv /home/grade12 /home/grade.classof2006
for x in 11 10 9 8 7 6 5 4 3 2 1
do
next=(( $x + 1 ))
echo moving grade${x} to grade${next}
mv /home/grade${x} /home/grade${next}
done

And if you wanted to get really clever, you could try to incorporate the first step, of 
moving the graduating 12th grade to listing it as its graduating year, into the loop. 
Speaking of which, I recall someone on the list mentioning a while back that they used 
each class's graduating year, rather than grade level, because then moving kids' folders 
and such becomes entirely unnecessary.

Petre

Kari Matthews wrote:
> Is there an automated way to graduate students from one directory to the
> next between school years with this method?  Just curious.
> 
> ~kari
> 
> 
> 
> 
> On 8/14/06, Sudev Barar <sbarar at gmail.com> wrote:
>>
>> On 15/08/06, Paul Lemke <lists at paulandmichelle.net> wrote:
>> > I was going to change the ownership of the home directories for the
>> kids...
>> > "username:teachergroup" and chmod it to 770. Then a softlink share in
>> samba
>> > would show all the users home directories. But it doesn't let me break
>> it up
>> > by gradegroup.
>> >
>>
>> Taking a swipe at this....
>> Make /home/grade1, /home/grade2 etc. under which make users of each
>> grade. Now make groups grade1 grade2 ... and make teachers of each
>> grade part of that group. Then directory permission with
>> user:gradegroup should do the job. Trick is to set sticky bit so that
>> the group ownership is automatically attached to all files created in
>> subdirectories.
>>
>> HTH
>> -- 
>> Regards,
>> Sudev Barar
>>
>> _______________________________________________
>> K12OSN mailing list
>> K12OSN at redhat.com
>> https://www.redhat.com/mailman/listinfo/k12osn
>> For more info see <http://www.k12os.org>
>>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>




More information about the K12OSN mailing list