...
Step 4: Restoring student data from initial backup:
Code Block |
---|
nnnnn |
...
ftv-san:~/kmm_ftvautomation# bash
[root@ftv-san ~/kmm_ftvautomation]# cd /mnt/tank0/Students/
[root@ftv-san /mnt/tank0/Students]# date && for d in * ; do rsync -rulv --exclude '.*' ../backup_2019_04_20_Students/$d/ $d/; done && date |
This took 35 minutes.
Step 5: Fix permissions on restored files:
Code Block |
---|
[root@ftv-san /mnt/tank0/Students]# for d in * ; do find $d/ -user root -type f | grep -Ev 'shared$|submissions$' | xargs -I {} -L 1 echo chown $d \'{}\' >> ~/kmm_ftvautomation/juststudentperms.sh ; done
[root@ftv-san /mnt/tank0/Students]# bash ~/kmm_ftvautomation/juststudentperms.sh |
This took a couple of minutes, but didn't completely work as expected. Several files contained unexpected quotes or other non-printable characters which kind of broke things. To get a list of everything you'll need to manually process, run the following:
Code Block |
---|
nnnnn |
...
[root@ftv-san /mnt/tank0/Students]# find . -user root -type f | grep -Ev 'shared$|submissions$' | cut -d '/' -f 2,3,4 | sort -u |
For each result returned, take advantage of the -R feature in chown and do things like this:
Code Block |
---|
[root@ftv-san /mnt/tank0/Students]# chown -R 1111111 "1111111/some guy's folder/" |
This manual process took 30-45 minutes.