Skip to content

Instantly share code, notes, and snippets.

@sgoley
Created August 27, 2021 01:14
Show Gist options
  • Save sgoley/1d93a838a12548c2295719dc61e5a031 to your computer and use it in GitHub Desktop.
Save sgoley/1d93a838a12548c2295719dc61e5a031 to your computer and use it in GitHub Desktop.
Creates a backup of all envs that exist for a conda installation
#!/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