Repository for storing scripts used by the Vanderbilt Astronomy Department.
Author: Victor Calderon ([email protected])
Date : 2017-09-01
To use the scripts in this repository, you must have Anaconda installed on the systems that will be running the scripts. This will simplify the process of installing all the dependencies.
For reference, see: https://conda.io/docs/user-guide/tasks/manage-environments.html
The package counts with a Makefile with useful functions. You must use this Makefile to ensure that you have all the necessary dependencies, as well as the correct conda environment.
- Show all available functions in the Makefile
$: make show-help
Available rules:
clean Delete all compiled Python files
environment Set up python interpreter environment
lint Lint using flake8
remove_environment Delete python interpreter environment
update_environment Update python interpreter environment
- Create the environment from the
environment.yml
file:
make environment
- Activate the new environment vandyscripts.
source activate vandyscripts
- To update the
environment.yml
file (when the required packages have changed):
make update_environment
- Deactivate the new environment:
source deactivate
To use the scripts in this repository, you must save the following environment variables:
AJC_Reminders
ajc_user
: Vanderbilt VUnet ID. This is used as the user for sending emails.ajc_pswd
: Password for you vanderbilt email address.
Astroweb_updates_xmlrpc
wp_username
: Username for the Astro Wordpress page.wp_password
: Password for the Astro Wordpress page.
Make sure to store these in your ~/.bashrc
or ~/.bash_profile
as environment variables for the scripts to work. If you don't know these passwords, contact the former person in charge of AJC.
Example of what to add to your profile
(.bashrc or .bash_profile) file:
### Vanderbilt Scripts
# AJC
ajc_user='VUnet ID'; export ajc_user
ajc_pswd='Password to your VUnet account'; export ajc_pswd
# Wordpress
wp_username='Username for AJC'; export wp_username
wp_password='Password for AJC'; export wp_password
Note: Replace the values for ajc_user, ajc_pswd, wp_username, and wp_password with the real values.
These scripts are meant to be run on a daily basis. You can do this by setting up a "crontab job". For further reference, see the "Crontab - Quick Reference ".
The file run_ajc_scripts.sh
has the necessary commands to run the scripts.
All you have to do is to add the following to your current crontab file:
0 7 * * * /path/to/run_ajc_scripts.sh
This will run run_ajc_scripts.sh
every day at 7am.
Note: Make sure you have had installed the vandyscripts
conda environment by running make environment
before you run this bash script.
You can check this by typing:
$: conda env list
vandyscripts /path/to/anaconda/envs/vandyscripts
root * /path/to/anaconda/
If you don't have a crontab file, you can add the command 0 7 * * * /path/to/run_ajc_scripts.sh
to the crontab file, after you have typed:
$: crontab -e
If you have a questions or feedback, please open an issue on Github.
Thanks!