diff options
-rwxr-xr-x | home/xyz/.local/bin/upd | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/home/xyz/.local/bin/upd b/home/xyz/.local/bin/upd index 79dc81e9..2510b4c3 100755 --- a/home/xyz/.local/bin/upd +++ b/home/xyz/.local/bin/upd @@ -9,20 +9,16 @@ all () { } backup () { - # pull repos and branches from studio, so duplicity will backup to ka, for one more backup for 321 backup rule + # Pull repos and branches from studio, so one more backup on insp or duplicity will backup to ka,for one more backup for 321 backup rule # cfgl master and pp branches already satisfy 321 rule. Here are three copies: 1. master/pp, 2. studio, 3. gitlab or alternative # But I still copy those on insp because one more copy will not hurt. And all my other data stil satisfy 3 copies without backup to gitlab, so why left out cfgl? Also it may be nice if I what to use that local dir for searching things. - git -C "$HOME/programs/config_local_arch" checkout master - git -C "$HOME/programs/config_local_arch" pull - git -C "$HOME/programs/config_local_arch" checkout pp - git -C "$HOME/programs/config_local_arch" pull - # pull repos and branches from studio, so one more backup on insp, for one more backup for 321 backup rule - git -C "$HOME/programs/config_local_arch" checkout studio - git -C "$HOME/programs/config_local_arch" pull - git -C "$HOME/programs/config_local_arch" checkout ka - git -C "$HOME/programs/config_local_arch" pull - # Push ka branch to codeberg or any future alternative website for mirroring. Needed for public codes/data, considering my death may result in all copies on my computers being lost. - git -C "$HOME/programs/config_local_arch" push + cd "$HOME/programs/config_local_arch" || exit 1 + git branch | awk '{print ($1=="*")?$2:$1}' | while read -r branch; do + git checkout "$branch" + git pull + # Push ka branch to codeberg or any future alternative website for mirroring. Needed for public codes/data, considering my death may result in all copies on my computers being lost. + [ "$branch" = ka ] && git push + done ( umask 077 sudo -E git -C /root/programs/config_local_arch_secrets_ka pull |