<commit_before>#!/bin/bash

IMAGE=bitstation
if [ "$1" != "" ] ; then
   IMAGE=$1
fi

mkdir -p ~/volumes/bitstation
pushd ~/volumes/bitstation
id=$(sudo docker create $IMAGE)

if [ ! -e ~/volumes/bitstation/home ] ; then
sudo docker cp $id:/home - | tar xf -
fi

if [ ! -e ~/volumes/bitstation/var/lib/dokuwiki ] ; then
mkdir -p var/lib
pushd var/lib
sudo docker cp $id:/var/lib/dokuwiki - | tar xf -
sudo docker run \
-v ~/volumes/bitstation/var/lib/dokuwiki:/var/lib/dokuwiki \
$IMAGE \
chown -R apache:apache /var/lib/dokuwiki
popd
fi

if [ ! -e ~/volumes/bitstation/var/log ] ; then
mkdir -p var
pushd var
sudo docker cp $id:/var/log - | tar xf -
popd
fi

sudo docker rm -v $id
popd
sudo systemctl stop httpd
# Reset firewall rules
sudo systemctl restart docker
sudo docker run --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v ~/volumes/bitstation/home:/home \
-v ~/volumes/bitstation/var/lib/dokuwiki:/var/lib/dokuwiki \
-v ~/volumes/bitstation/var/log:/var/log \
-p 80:80 -p 443:443 $IMAGE<commit_msg>fix log format<commit_after>#!/bin/bash

IMAGE=bitstation
if [ "$1" != "" ] ; then
   IMAGE=$1
fi

mkdir -p ~/volumes/bitstation
pushd ~/volumes/bitstation
id=$(sudo docker create $IMAGE)

if [ ! -e ~/volumes/bitstation/var/log ] ; then
mkdir -p var/log
pushd var
sudo docker run \
-v ~/volumes/bitstation/var/log:/mnt \
$IMAGE \
cp -a -P -R /var/log/* /mnt
popd
fi

if [ ! -e ~/volumes/bitstation/home ] ; then
sudo docker cp $id:/home - | tar xf -
fi

if [ ! -e ~/volumes/bitstation/var/lib/dokuwiki ] ; then
mkdir -p var/lib
pushd var/lib
sudo docker cp $id:/var/lib/dokuwiki - | tar xf -
sudo docker run \
-v ~/volumes/bitstation/var/lib/dokuwiki:/var/lib/dokuwiki \
$IMAGE \
chown -R apache:apache /var/lib/dokuwiki
popd
fi


sudo docker rm -v $id
popd
sudo systemctl stop httpd
# Reset firewall rules
sudo systemctl restart docker
sudo docker run --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
-v ~/volumes/bitstation/home:/home \
-v ~/volumes/bitstation/var/lib/dokuwiki:/var/lib/dokuwiki \
-v ~/volumes/bitstation/var/log:/var/log \
-p 80:80 -p 443:443 $IMAGE
{'fraction_non_alphanumeric': 0.15746519443110898, 'fraction_numerical': 0.011521843494959194, 'mean_word_length': 3.176352705410822, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2981045', 'n_tokens_mistral': 929, 'n_tokens_neox': 831, 'n_words': 217}