To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / deploy / provision.d / 115-other-dirs.sh @ 1604:2162f6ff8580
History | View | Annotate | Download (760 Bytes)
| 1 |
#!/bin/bash |
|---|---|
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
# Initialise directories used as targets for cron activity (if they |
| 6 |
# don't already exist) |
| 7 |
|
| 8 |
# Reminder: the webapp directory is owned and run by the code user, in |
| 9 |
# group www-data. The repos and other things served directly are |
| 10 |
# usually the other way around -- owned by the www-data user, in group |
| 11 |
# code. I don't recall whether there is a good reason for this. |
| 12 |
|
| 13 |
for dir in \ |
| 14 |
/var/files/backups \ |
| 15 |
/var/doc \ |
| 16 |
/var/files/git-mirror ; do |
| 17 |
if [ ! -d "$dir" ]; then |
| 18 |
mkdir -p "$dir" |
| 19 |
chown -R code.www-data "$dir" |
| 20 |
chmod g+s "$dir" |
| 21 |
fi |
| 22 |
done |
| 23 |
|
| 24 |
for dir in \ |
| 25 |
/var/mirror ; do |
| 26 |
if [ ! -d "$dir" ]; then |
| 27 |
mkdir -p "$dir" |
| 28 |
chown -R www-data.code "$dir" |
| 29 |
chmod g+s "$dir" |
| 30 |
fi |
| 31 |
done |