annotate deploy/provision.d/115-other-dirs.sh @ 1628:9c5f8e24dadc live tip

Quieten this cron script
author Chris Cannam
date Tue, 25 Aug 2020 11:38:49 +0100
parents 90bed4e10cc8
children
rev   line source
Chris@1598 1 #!/bin/bash
Chris@1598 2
Chris@1598 3 set -e
Chris@1598 4
Chris@1598 5 # Initialise directories used as targets for cron activity (if they
Chris@1598 6 # don't already exist)
Chris@1598 7
Chris@1598 8 # Reminder: the webapp directory is owned and run by the code user, in
Chris@1598 9 # group www-data. The repos and other things served directly are
Chris@1598 10 # usually the other way around -- owned by the www-data user, in group
Chris@1598 11 # code. I don't recall whether there is a good reason for this.
Chris@1598 12
Chris@1598 13 for dir in \
Chris@1598 14 /var/files/backups \
Chris@1598 15 /var/doc \
Chris@1613 16 /var/files/code \
Chris@1598 17 /var/files/git-mirror ; do
Chris@1598 18 if [ ! -d "$dir" ]; then
Chris@1598 19 mkdir -p "$dir"
Chris@1598 20 chown -R code.www-data "$dir"
Chris@1598 21 chmod g+s "$dir"
Chris@1598 22 fi
Chris@1598 23 done
Chris@1598 24
Chris@1598 25 for dir in \
Chris@1598 26 /var/mirror ; do
Chris@1598 27 if [ ! -d "$dir" ]; then
Chris@1598 28 mkdir -p "$dir"
Chris@1598 29 chown -R www-data.code "$dir"
Chris@1598 30 chmod g+s "$dir"
Chris@1598 31 fi
Chris@1598 32 done
Chris@1613 33
Chris@1613 34 if [ ! -e /var/www/code/files ]; then
Chris@1613 35 ln -s /var/files/code /var/www/code/files
Chris@1613 36 fi