cron scripts

main
eric 2023-04-26 16:22:05 -04:00
parent 53e3f655c6
commit 3e0b3fbc93
4 changed files with 12 additions and 2 deletions

View File

@ -130,7 +130,7 @@ def load_doab_oai(from_date, until_date, limit=100):
from_ = from_date
else:
# last 15 days
from_ = datetime.datetime.now(pytz.UTC) - datetime.timedelta(days=15)
from_ = datetime.datetime.now() - datetime.timedelta(days=7)
num_doabs = 0
new_doabs = 0
lasttime = datetime.datetime(2000, 1, 1)

View File

@ -17,7 +17,7 @@ class Command(BaseCommand):
default=None, help="YYYY-MM-DD to start")
parser.add_argument('--until', nargs='?', type=timefromiso,
default=None, help="YYYY-MM-DD to end")
parser.add_argument('--max', nargs='?', type=int, default=None, help="max desired records")
parser.add_argument('--max', nargs='?', type=int, default=1000, help="max desired records")
def handle(self, from_date, **options):
until_date = options['until']

5
scripts/doab_check.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
#
cd /home/ubuntu/doab-check
/home/ubuntu/.local/bin/pipenv run python manage.py check_items >> cron_check.log

5
scripts/doab_load.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
#
cd /home/ubuntu/doab-check
/home/ubuntu/.local/bin/pipenv run python manage.py load_doab >> logs/cron_load.log