Fixed PATH, and several conditionals
This commit is contained in:
parent
787c4c5b2f
commit
bcfb55a4be
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PATH=/Users/tblancher/homebrew/Cellar/gnu-tar/1.34_1/libexec/gnubin:/Users/tblancher/homebrew/Cellar/coreutils/9.1/libexec/gnubin:/Users/tblancher/homebrew/bin
|
PATH=/Users/tblancher/homebrew/opt/coreutils/libexec/gnubin:/Users/tblancher/homebrew/opt/gnu-tar/libexec/gnubin:/Users/tblancher/bin:/Users/tblancher/homebrew/bin:/Users/tblancher/homebrew/sbin:/Users/tblancher/gem/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/sbin:/usr/sbin:/Users/tblancher/bin
|
||||||
|
|
||||||
MONTH=$(( $(date +%m) - 1 ))
|
MONTH=$(( $(date +%m) - 1 ))
|
||||||
if [ "x$1" == "x" ]
|
if [[ -z "$1" ]]
|
||||||
then
|
then
|
||||||
YEAR=$(( $(date +%Y) - 1))
|
YEAR=$(( $(date +%Y) - 1))
|
||||||
ONESET=true
|
ONESET=true
|
||||||
|
@ -15,9 +16,9 @@ if [ $MONTH -eq 0 ];
|
||||||
then
|
then
|
||||||
MONTH=12
|
MONTH=12
|
||||||
if [[ ! ${ONESET} ]]; then
|
if [[ ! ${ONESET} ]]; then
|
||||||
YEAR=$(( $YEAR - 1))
|
YEAR=$(( YEAR - 1))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tar -cvJf $YEAR.tar $YEAR-*.tar.xz --remove-files
|
tar -cvJf "$YEAR.tar" $YEAR-*.tar.xz --remove-files
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue