pariyatti / kosa

Digital library service
GNU Affero General Public License v3.0
8 stars 3 forks source link

Add more logs for cron file run and comment out bashrc line #71

Closed balwa closed 2 years ago

balwa commented 2 years ago

Add more logs for cron file run and comment out bashrc line that causes python script error of not being able to find the env variables.

For the last 3-4 weeks i have was checking for the backup notification on Wednesday to arrive on discord and they didn't arrive 😄

    s3_bucket_name = os.environ["BACKUP_S3_BUCKET"]
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'BACKUP_S3_BUCKET'

The script was failing to find env variable because [ -z "$PS1" ] && return ensured the sourcing of bashrc didn't do anything. So fix was to comment it. In the process I found probably having the last cron job run log in the kosa logs directory can also help in troubleshooting issues related to s3 backups.

This Wednesday, the notifications did arrive, finally😀

Screen Shot 2022-07-16 at 4 32 29 PM

So, changes are tested and verified to work!