Skip to content

Commit

Permalink
fix measurement_data_dumps location
Browse files Browse the repository at this point in the history
set measurement_data_dumps directory in pyscada home during the venv
installation
use that folder in default settings.py
  • Loading branch information
clavay authored and trombastic committed Oct 16, 2023
1 parent 5a59337 commit 67187cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions install_venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ fi
INSTALL_ROOT=/var/www/pyscada # files will be installed here
log_file_dir="/var/log/pyscada/" # log files will be here
SERVER_ROOT=$INSTALL_ROOT/PyScadaServer # django project root
pyscada_venv=/home/pyscada/.venv
pyscada_home=/home/pyscada
pyscada_venv=$pyscada_home/.venv

# VAR
answer_date="" # Is the date correct
Expand Down Expand Up @@ -419,6 +420,7 @@ with open("./tests/project_template_tmp/project_name/settings.py-tpl", "r+") as
"db_user": "${answer_db_user}",
"db_password": "${answer_db_password}",
"project_root": "${INSTALL_ROOT}",
"pyscada_home": "${pyscada_home}",
"log_file_dir": "${log_file_dir}",
"project_admins": "${project_admins}",
"auto_add_apps": "${answer_auto_add_apps}",
Expand All @@ -444,14 +446,12 @@ function user_setup(){
# Create pyscada user
echo "Creating system user pyscada..."
useradd -r pyscada
mkdir -p /home/pyscada
chown -R pyscada:pyscada /home/pyscada
mkdir -p $INSTALL_ROOT/http/measurement_data_dumps
chown -R pyscada:pyscada $INSTALL_ROOT
mkdir -p $pyscada_home
chown -R pyscada:pyscada $pyscada_home
mkdir -p $INSTALL_ROOT
chown -R pyscada:pyscada $INSTALL_ROOT
mkdir -p $INSTALL_ROOT/http/measurement_data_dumps
chown -R pyscada:pyscada $INSTALL_ROOT/http/measurement_data_dumps
mkdir -p $pyscada_home/measurement_data_dumps
chown -R pyscada:pyscada $pyscada_home/measurement_data_dumps

mkdir ${log_file_dir}
chown pyscada:pyscada ${log_file_dir}
Expand Down
2 changes: 1 addition & 1 deletion tests/project_template/project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ PYSCADA_META = {
# file_prefix prefix of the output files (PREFIXmeasurement_data_Y_m_d_HM.[h5,csv])

PYSCADA_EXPORT = {
'output_folder': '{{ project_root }}/http/measurement_data_dumps',
'output_folder': '{{ pyscada_home }}/measurement_data_dumps',
'file_prefix': PYSCADA_META['name'] + '_'
}

Expand Down

0 comments on commit 67187cf

Please sign in to comment.