Skip to content

Instantly share code, notes, and snippets.

@planetceres
Last active March 27, 2018 21:27
Show Gist options
  • Save planetceres/fbf34406a0a92c1de5ed2adda689b563 to your computer and use it in GitHub Desktop.
Save planetceres/fbf34406a0a92c1de5ed2adda689b563 to your computer and use it in GitHub Desktop.
[Deprecated] Backup all Anaconda environments `bash conda_backup_env.sh <folder path for backup>`
#!/bin/bash
NOW=$(date "+%Y-%m-%d")
DIR=$1
mkdir $DIR/envs-$NOW
ENVS=$(conda env list | grep '^\w' | cut -d' ' -f1)
for env in $ENVS; do
source activate $env
conda env export > $DIR/envs-$NOW/$env.yml
echo "Exporting $env to .yml"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment