#!/bin/bash
[ -f $HOME/.gitconfig ] || {
cat > $HOME/.gitconfig << NNNN
# (c) 2016-2022 Demo Suremo
# This is a simple free git config file
# REV01 Tue 18 Jan 2022 16:50:52 WIB
# START Thu 22 Dec 2016 19:10:42 WIB
NNNN
}
git config --global user.email '97488221+demosuremo@users.noreply.github.com'
git config --global user.name 'Demo Suremo'
git config --global user.signingkey '8F1421741FC7A9C95DFD3E41E2A5C7F127C418FF'
git config --global core.editor 'vi'
git config --global core.autocrlf 'false'
git config --global core.safecrlf 'false'
git config --global credential.helper 'cache --timeout=7200'
git config --global pull.rebase 'true'
git config --global merge.conflictstyle 'diff3'
git config --global gitflow.prefix.hotfix 'hotfix/'
git config --global gitflow.prefix.feature 'feature/'
git config --global gitflow.prefix.bugfix 'bugfix/'
git config --global gitflow.prefix.release 'release/'
git config --global gitflow.prefix.support 'support/'
git config --global init.defaultBranch 'master'
[ -f $HOME/.gitconfig ] && cat $HOME/.gitconfig
#################################################################################### EOF ====
#!/bin/bash
# START Tue 18 Jan 2022 23:08:21 WIB
# Membuat directory "ZBACKUP/", "ZBACKUP/.ZBACKUP", "ZBACKUP/.ZBACKUP/ISO/"
mkdir -pv $HOME/ZBACKUP/.ZBACKUP/ISO/
############################################ ISO =====
# Membuat berkas "dummy.iso"
touch $HOME/ZBACKUP/.ZBACKUP/ISO/dummy.iso
# Link "ISO/" ke ".ZBACKUP/ISO/"
cd $HOME/ZBACKUP/
ln -s .ZBACKUP/ISO/
############################################ GITHUB =====
# Clone "demo" dari "GITHUB"
cd $HOME/ZBACKUP/
git clone git@github.com:demosuremo/demo.git
# Membuat repo "bare" untuk BACKUP
git init --bare .ZBACKUP/demo/
cd demo/
# Setup BACKUP
git remote add BACKUP ../.ZBACKUP/demo/
# Test PUSH/PULL
git pull
git push
git push BACKUP
git pull BACKUP master
############################################ GIT LOCAL "pdf2022" =====
cd $HOME/ZBACKUP/
git init pdf2022/
git init --bare .ZBACKUP/pdf2022/
cd pdf2022/
git commit -am "Initial Commit" --allow-empty
touch dummy.pdf
git add -A
git commit -m "Init:pdf2022"
git remote add origin ../.ZBACKUP/pdf2022/
git push --set-upstream origin master;
cd $HOME/ZBACKUP/
############################################################ EOF =====
#!/bin/bash
# START Wed 19 Jan 2022 00:02:38 WIB
BACKUP=".ZBACKUP/"
SRC="$HOME/ZBACKUP/$BACKUP"
USB="/mnt/usb/$BACKUP"
[ -d $USB ] || { echo "ERROR: No $USB" ; exit 1; }
[ -d $SRC ] || { echo "ERROR: No $SRC" ; exit 1; }
rsync -auvc --progress $SRC $USB
################################################## EOF =====