add crontab scripts to build-deb and fix CONFIG_PATH in donationconfig.py

This commit is contained in:
fram3d 2023-07-13 18:28:16 +02:00
parent f410b78c8a
commit c24ce7f2d9
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
4 changed files with 15 additions and 3 deletions

View File

@ -0,0 +1,7 @@
#!/bin/sh
/usr/bin/echo "Adding monthly rebalance to crontab"
/usr/bin/crontab -l > /tmp/donationcalccrontab.tmp
/usr/bin/echo "0 0 1 * * /usr/bin/python3 /var/donationcalc/run.py -r" >> /tmp/donationcalccrontab.tmp
/usr/bin/crontab /tmp/donationcalccrontab.tmp
/usr/bin/rm /tmp/donationcalccrontab.tmp

View File

@ -0,0 +1,7 @@
#!/bin/sh
/usr/bin/echo "Removing monthly rebalance to crontab"
/usr/bin/crontab -l > /tmp/donationcalccrontab.tmp
/usr/bin/grep -v "0 0 1 * * /usr/bin/python3 /var/donationcalc/run.py -r" /tmp/donationcalccrontab.tmp >> /tmp/donationcalccrontab.tmp1
/usr/bin/crontab /tmp/donationcalccrontab.tmp1
/usr/bin/rm /tmp/donationcalccrontab.tmp /tmp/donationcalccrontab.tmp1

View File

@ -1,8 +1,7 @@
import configparser import configparser
class donationconfig(): class donationconfig():
#CONFIG_PATH = "/var/donationcalc/donationcalc/config.ini" CONFIG_PATH = "/var/donationcalc/donationcalc/config.ini"
CONFIG_PATH = "/home/anon/src/donationcalc/donationcalc/config.ini"
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(CONFIG_PATH) config.read(CONFIG_PATH)

View File

@ -1,2 +1 @@
flask flask
schedule