tblancher's timetracker timekeeping system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
328 B

#!/bin/bash
MONTH=$(( $(date +%m) - 1 ))
if [ "x$1" == "x" ]
then
YEAR=$(( $(date +%Y) - 1))
ONESET=true
else
YEAR=$1
fi
echo "Tarring up for year ${YEAR}..."
if [ $MONTH -eq 0 ];
then
MONTH=12
if [[ ! ${ONESET} ]]; then
YEAR=$(( $YEAR - 1))
fi
fi
tar -cvJf $YEAR.tar $YEAR-*.tar.xz --remove-files