Skip to content

Commit

Permalink
Merge pull request #832 from jan-stanek/offers-script
Browse files Browse the repository at this point in the history
Offers update script fix
  • Loading branch information
msusicky committed Apr 23, 2024
2 parents 3dcec9b + bbaaf89 commit da299de
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions scripts/create_static_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if [ $wget_res -ne 0 ]; then
fi

find $WEB_DIR -name "*.html" -type f -delete

cp -r ${WEB_TMP_DIR}/127.0.0.1:5000/* ${WEB_DIR}/
rm -r $WEB_TMP_DIR

Expand Down
14 changes: 11 additions & 3 deletions scripts/create_static_pages_offers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ WEB_DIR="/home/ockovani/prd/web/ockovani-covid-pages"

mkdir -p $WEB_TMP_DIR

wget -P $WEB_TMP_DIR -e robots=off --adjust-extension http://127.0.0.1:5000/nabidky
wget -r -P $WEB_TMP_DIR -e robots=off --adjust-extension -l 2 -I /nabidky,/praktik,/okres,/kraj http://127.0.0.1:5000/nabidky
wget_res=$?

if [ $wget_res -ne 0 ]; then
rm -r $WEB_TMP_DIR
exit $wget_res
fi

cp ${WEB_TMP_DIR}/nabidky.html ${WEB_DIR}/
wget -P $WEB_TMP_DIR/127.0.0.1:5000 -e robots=off --adjust-extension http://127.0.0.1:5000/praktici
wget_res=$?

if [ $wget_res -ne 0 ]; then
rm -r $WEB_TMP_DIR
exit $wget_res
fi

cp -r ${WEB_TMP_DIR}/127.0.0.1:5000/* ${WEB_DIR}/
rm -r $WEB_TMP_DIR

cd $WEB_DIR || exit 1
git add *
git commit -am "Update"
git commit -am "Update offers"
git push origin master
12 changes: 8 additions & 4 deletions scripts/cron
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# daily fetcher
30 6 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 15481697
# hourly fetcher
30 7-22 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 15481698
20 6 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 15481697

# hourly fetcher - disabled, centers probably don't update that often
# 30 7-22 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 15481698

# monthly fetcher
00 5 5 * * bash /home/ockovani/prd/app/scripts/execute_action.sh 16635318

# update GP page
1/5 * * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 94783487
2/5 * * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 94783487

# post tweet - disabled
# 35 7 * * * bash /home/ockovani/prd/app/scripts/execute_action.sh 6797956

0 comments on commit da299de

Please sign in to comment.