Skip to content

Instantly share code, notes, and snippets.

@justinian
justinian / backup_my_repos.sh
Last active September 3, 2020 20:14
GitHub & Bitbucket backup scripts
#!/bin/bash
BACKUP_DIR="/home/justin/backups/git"
cd "$BACKUP_DIR"
for repo_url in `list_my_repos.sh`; do
repo_dir=`echo $repo_url | sed 's/^....//' | tr ':/@' '___'`
git clone --mirror "$repo_url" "/tmp/$repo_dir" > /dev/null 2>&1
git --git-dir "/tmp/$repo_dir" bundle create "$repo_dir.bundle.new" --all > /dev/null 2>&1
if [ -f "$repo_dir.bundle" ]; then rm "$repo_dir.bundle"; fi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@erichelgeson
erichelgeson / .kitchen.local.yml
Last active June 22, 2017 14:03
kitchen.local.yml cache chef package (simple)
driver:
synced_folders: [
["./chef-installer", "/tmp/chef-installer"]
]
provisioner:
chef_omnibus_url: file:///tmp/chef-installer/install.sh # curl can accept a local file:// url