Last active
October 12, 2021 15:26
-
-
Save varqox/4b2e43aaa8c7714d563049271f96b0da to your computer and use it in GitHub Desktop.
Revisions
-
varqox revised this gist
Oct 12, 2021 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,11 @@ cd -P -- "$(dirname -- "$0")" # chdir to script directory out_file="$HOME/backup/$(echo ${PWD#$HOME/} | sed 's@/@,@g').tar.zst" ((git ls-files -z --cached --recurse-submodules 2> /dev/null && git ls-files -z --others --exclude-standard && PROJECT_DIR=$PWD git submodule foreach --quiet 'git ls-files -z -o --exclude-standard | while read -d "" x; do echo -n "${PWD#$PROJECT_DIR/}/$x"; echo -ne "\0"; done' && echo -ne '.git\0' ) || ls --zero -A) | \ xargs --null tar --create --zst --file "$out_file" du -sh "$out_file" -
varqox created this gist
Oct 1, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/bin/sh set -e cd -P -- "$(dirname -- "$0")" # chdir to script directory out_file="$HOME/backup/$(echo ${PWD#$HOME/} | sed 's@/@,@g').tar.zst" ((git ls-files --cached --recurse-submodules 2> /dev/null && git ls-files --others --exclude-standard && PROJECT_DIR=$PWD git submodule foreach --quiet 'git ls-files -o --exclude-standard | while read x; do echo "${PWD#$PROJECT_DIR/}/$x"; done' && echo .git ) || ls -A) | \ xargs tar c --zst -f "$out_file" du -sh "$out_file"