Howto: Clean Class Shares at the end of the school period

Howto clean class shares at the end of the school period

In ucs@school class shares are not cleaned automatically. This is because there might be files which are worth to be saved (i.e. by teachers).
In case you want to clean all shares you might do this manually by the help of a script.

Step 1

Create a bash script named as follows:

cd /home/$(ucr get samba4/join/site)/groups/klassen || exit 255
for i in $(find  . -maxdepth 1 -type d| grep -v " "); do
   pushd $i && rm -rf *

Step 2

Mark this script executalbe:
chmod +x

Step 3

Start the script: ./
Note: This will wipe every content under the classes shares directories!

1 Like

This topic was automatically closed after 24 hours. New replies are no longer allowed.