Add cronjob to fetch new timetable data from HSL
This commit is contained in:
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Adding cron entries..."
|
||||
# write out current crontab
|
||||
crontab -l > temp_crontab
|
||||
# echo new cron into cron file
|
||||
printf "*/5 * * * * source $PWD/../virtualenv.sikweb/bin/activate && python $PWD/manage.py hsl &>$PWD/logs/fetch_hsl.log\n\n" >> temp_crontab
|
||||
# install new cron file
|
||||
crontab temp_crontab
|
||||
rm temp_crontab
|
||||
echo "Done. View your crontab with 'crontab -l' and edit it with 'crontab -e'."
|
||||
Reference in New Issue
Block a user