Created
August 27, 2021 01:14
-
-
Save sgoley/1d93a838a12548c2295719dc61e5a031 to your computer and use it in GitHub Desktop.
Creates a backup of all envs that exist for a conda installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NOW=$(date "+%Y-%m-%d") | |
mkdir $HOME/tmp/envs-$NOW | |
ENVS=$(conda env list | grep '^\w' | cut -d' ' -f1) | |
for env in $ENVS; do | |
source activate $env | |
conda env export > $HOME/tmp/envs-$NOW/$env.yml | |
echo "Exporting $env" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment